#multiplayer
1 messages ยท Page 43 of 1
Dude, use that method I mentioned above to get the pawn to then check IsLocallyControlled
chain one into the other
Red squiggles were never a real error
: error C3861: 'TryGetPawnOwner': identifier not found
And if you get an error in the output log saying that function doesn't exist then you are probably not in a subclass to UAnimInstance
You are just sending uncomplete info to your issue hoping we guess what's happening
thanks
What?
If there are clients, there must be a server, otherwise they wouldn't be clients.
Can you have server RPC in anim instance using GetLifetimeReplicatedProps? I think it's for actor class only right
The anim stuff gets derived from the actor it is attached too
You don't do networking inside of animations
AnimBP?
Nope. Whatever information your animation needs, you get it from the anim instance owner.
Does anyone know how to have a custom movement mode also work with the FLAG_JumpPressed. I use this in GetCompressedFlags()
if (Saved_bPressedJumpForClimb) Result |= FLAG_JumpPressed; ```
But it makes the character jump when the server runs UpdateFromCompressedFlags() and sets
```cpp
CharacterOwner->bPressedJump = ((Flags & FSavedMove_Character::FLAG_JumpPressed) != 0);```
Then it goes into my climbing state. All this causing a net correction as the server starts making us jump as the client didn't.
is there a way to replicate variables and trigger their repnotify functions on clients whenever they are set even if the value stays the same instead of only when they change?
There is a notify macro. I forget the exact name. It's like DOREPLIFETIME_CONDITION_NOTIFY() I think.
Last argument you pass in is REPNOTIFY_Always
ahhhhh thanks this sounds a bit like what im looking for ill try and dig up some more info about it
im not exactly sure what I should put in for the condition as in the second last parameter as i still want it to be 'normal' i guess
maybe COND_Custom and do nothing with it?
I think COND_None is as if there is no special condition
have you considered using different custom flag setting? 1h 2h 4h and 8h are reserved, but 10h, 20h, 40h, and 80h are free for use
i would assume that if you decoupled anything related to your climb state away from that flag/the jump in ACharacter and relied on a custom flag in that free zone it would help?
in the client, ARPin are not loaded but in the editor I checked anchor has been loaded,
So I'm calling a multicast on my enemy actor when it dies to play the death animation so all the clients see it, but when the client is the one who kills the enemy, it only plays for the client and not the server
how do I have the client shoot the enemy and have that call a multicast that runs the code for everyone?
so the documentation says multicasts called by the client will only run on the client, so if the client is the one initiating the enemy death, how do I get the server to run the multicast?
Very basic example:
- Client sends server an RPC to do attack action (shoot, swing sword, whatever)
- Server processes the RPC and does the attack
- Server determines enemy dies
- Server sets enemy status as dead, turns off their AI etc.
- Server does multicast of enemy dying montage
- Server sleeps for a few seconds, then "destroys" enemy (to despawn them).
The client does nothing except telling the server it wanted to attack.
So the way I have it set up now, the client initiated the fire input, calling an event that's set to Run on Server which performs the ray trace and enemy health calculation, then calls an event EnemyDeath on the enemy actor which sets it to dead and gives the player controller some points, then called Multicast_EnemyDeath which plays the death animation and destroys the actor
"then calls an event EnemyDeath" - is that the client or the server calling that event? Needs to be the server.
It's in the same exec line as the ray trace, so the Server_LineTrace is what calls the EnemyDeath event
and Server_LineTrace is ofc set to Run on Server
Is this c++ or BP?
BP
are you sure the server is running that code? maybe post some screenshots. But add some 'Print String' debugs and confirm its doing what you expect.
I'm not sure, but the event is set to Run on Server and I've messed around with basically setting everything to that to no avail
so when you do "print string" there, does the printed string say "Server: XXX" or "Client: XXX"
Client
and then follow it from there
yeah so I just put a print string right after the line trace call and it said Client: Hello
even though it's set to Run on Server???
"if enemy not dead, substract health by damamge" - what is BEFORe that screenshot?
i.e. where is that Exec pin coming from?
and before that?
I dont think you can do "get player character" in that command, because that would get the server's character. You need to pass in a ref to the character doing the shooting when you call it.
I can do that, but is that what's causing everything else?
because line trace is still supposed to run on the server but the print string says client
(you already have a ref to the char, so just use that from the input)
okay, did that
I'm not super strong in BP. Maybe someone else can jump in. I'm just wondering if you own the Pistol or not? or does the server own the pistol, so it wont fire your rpc?
I don't think anything owns the pistol right now, I couldn't figure out how to set the owner to the right players
I was using set owner on the player character but it was run locally and I guess set every pistol to be owned by the server player
so the way I would do it personally is; the Player says "I want to fire", and gives a ref to the pistol it wants to fire.
Then the rest from there.
not "hey pistol fire" via the char
you def own the player/pawn - but you might not own the pistol depending how its set?
yeah I didn't set the pistol owner anywhere
so whatever the default is when it gets spawned in
Then 1 is unrelated
right - so because thats in BeginPlay - every client is spawning their own pistol locally that is not replicated
you need to do a switch Has Authority, and have only the Server spawn the pistol for each person, and then replicate it across
so your problem is here, not in the fire stuff
:O
hold on let me process that
so how do I have the server spawn the pistol? do I have BeginPlay call an event set to run on the server?
lots of different ways - depends what you want. One option is BeginPlay -> Server_RequestPistol, and the client can tell the server it would like a pistol given to it. Then server actions that.
or you could do some stuff around when a player joins, hook into that event, and the server just assigns it. Or at start of match, the server just gives everyone a gun
Or your bp_player_character could start with a pistol already attached
and for Server_RequestPistol, I would pass in the mesh that has the socket, attach the pistol to the socket, and then go from there?
basically as one option - yep
i'm sure there are other (better) ways - thats just one way
So why does setting the Pistol actor to Replicates not fix this?
because the client is spawning it. Only the server can spawn something that you want to exist everywhere
ohhh
that makes sense
I could use OnPostLogin maybe? each time a new player joins it spawns a pistol to them?
also, thank you so much for help! I appreciate it :D
RestartPlayer is probably the better method
ah, never used that before
Hi all, I have a question regarding saving the player state. For example, if the player picked up an item to inventory so should we use socket to save data to server database or how can we do that?
Google RPCs.
Thanks, @latent heart.
Hello, Im trying to spawn a weapon through the UI so that the player can pick it up and use the weapon, the problem is, the sword bein g spawned is not replicated, is there something wrong with my code? Or doI need to handle spawning this another way, any help is appreciated!
You would need to calculate the Actor location on the Server without using the client code. i.e. you cant have the lines joined like that AFAIK.
ummm im not fully understanding the sencond part nor first part, do you mind elaborating?
Because when the server runs its part of the code, the previous calculation was never done on the server
you are probably spawning the gun at 0,0,0 at the moment
its weird because the actor spawns, but my interact code wont work with it vs when I spawn it in before I hit play, then my interaction code works, sorry for the confusion
hello everyone, do you know of any service that is not EOS which is supporting p2p matchmaking + NAT handling and has good unreal integration? best case: no user accounts (like steam or epic) / most awesome would be anonymous login without any need for the user to input. best alternative would be custm username and password
I add one more criteria: no need for a user account or custom accounts with password and username
thanks. should have made my question a little more detailed (edited)
is there any way to join to dedicated server in the editor by using cmd?
you are saying to me?
Yes
Oh
You can't join a "dedicated editor session"
But you can join a dedicated game server.
I'm very begginer I can show you this
ohh
I have problem in the client ARPin are not loaded in the way to this
so I'm thinking another way
without using that exe file to join to server, is there any way to join in the editor by using cmd?
You'd have to start a PIE instance first.
Are anim montages net adressable?
Guys I have a problem I had a game with planes my planes was did with Pawn I could fight each other fly etc, then I made multiplayer game where main character was normaln third person character yea I did session,dedicated server etc everything was working I could see other players playerd with them etc, but then I tried to combine these two games and use planes in my multiplayer game but there comes problem I dont see planes / joined players in session like Pawn was not replicated, any tips what I can do ?
They should be as they are assets
So any data-asset like thing and TSubclassOf/UClass* are net adressable?
I guess basically every CDO is net adressable then?
Correct
They are picked from editor, so they are loaded for both ends
They can be referred to by their path so it's all good
In packaged builds they have to be packaged ofc
Alright, 
Thank you! I don't know well What PIE instance is, I'm searching now!
Play In Editor
If you run one on a Mac, it's apple flavoured.
anyone have idea of solution to my problem ? :/
Missed opportunity for a Picard reference.
u mean class Pawn
?
but Actor is replicating and I did nothing
it was replicating from start
this is plane and this my person
character
second is working fine first is not
Working could mean a lot of things
If you mean character is replicating but plane is not then check the replication settings for the plane
And how you spawn the plane
I am not sure if its true but I red somewhere that Pawn classes are not replicated by default in ue 5 just Actors are and idk what is true,working means I started game joined session and was inside with 2 players and I saw each other, when I tried it with "plane" I was on map joined session but I was alone on map even we joined with 2 accounts. I spawn them like this just change this to PlanePawn/ ThirdPErsonCharacter and on map is player start
Then just make sure that PlanePawn BP replicates
I am gonna check settings
so sentence that Pawns are non replicated by default is false?
here I have these settings but on but here is not ticked
maybe this?
but in my character is not ticked
so I am confused ๐
They do replicate by default but in your case they don't because they don't inherit that from their parent ctor
In the case of character they do
So yes that should be ticked
For the actor
Not the component
also there is 1 interesting thing what happened when I try run map as client and choose 2 windows with server behind / from editor I am on map with both pawn and see each other
but in case I am trying it in my session I see only actor but not pawns
in this mode
i see pawns in game normally
Then you are not joining the other pawn session
example
hmm
so I should check logs from session?
bcs is there logic that it work in simulated server by editor but not on my dedicated server in session?
I dont think
both should be same or?
Replication is not your issue as long as that pawn is replicating and you are letting vanilla UE code to spawn them
okay
Quick question, I'm using seamlesstravel in UE5 and for some weird reason it can happen that one player travels to the new level but the host doesn't call AGameModeBase::SwapPlayerControllers & APlayerState::CopyProperties for it, all other players work as expected? This somehow breaks replication for that specific character later?
Has anyone encountered something similar or can point me in a direction to solve this? (Would be awesome if you can tag me directly so I get the ping <3)
The PlayerControllerClass is the same in both levels.
hm I realized I am getting this type of log but then my connections show I am joined to server sooo I dont understand hmmm
but that log means I propably didnt join right session
however I see /errors on my dedicated server which means someone connected, I am confused
Tbf I already answered your question, and sessions is that way #online-subsystems
How do you know it doesn't call these functions for a specific player? I would assume you have debugged your code and saw that they are not executing, at which case you know why they don't as there are checks before you are routed to execute them. Check why the checks are failing for that specific player
Also if you are seamless traveling in editor under one process (the new ue5 feature thingy) then I would try not to do that as that could be not stable
For example SwapPlayerControllers doesn't get called if the new GameMode's class is a subcalss of AGameMode and that the old and new PlayerController's classes are the same
Im trying to replicate my proning mechanic. Im changing capsule half size and i am lifting the mesh up when proning to avoid this clipping trough the ground. First i do that on the client and then i pass those values over to my server or multicast function which also set the new relative location and the capsule half size. As you can see the capsule half size is replicated perfectly. But the relative location of the mesh isnt. Can anybody give me a hint?
so basically it isnt replicating the location at all.
I'm trying to connect 2 clients through EOS, need to use packaged builds for that, and I'm now getting this error:
[2022.12.18-05.52.28:388][201]LogNet: UNetConnection::SendCloseReason:
[2022.12.18-05.52.28:388][201]LogNet: - Result=MissingLevelPackage, ErrorContext="/Memory/MainGrid_L8_X0_Y0_DL0,/Memory/MainGrid_L8_X0_Y0_DL0"```
The map is packaged.. and I see it on the connecting client for a few frames, yet there seems to be an error of some "portion" of it missing from world partition?
So i made this little custom testing code. Server to client replication works, but Client to server does not. (client to client works too) The setLocMulti does even get triggered on the server side for that character. But still it doesnt set the new relative location. What do i overlook? or is this even a bug?
No matter what i try the relative lcoation of a client character cant be changed on the server
if someone would be able to tell me whats wrong, that would be awesome cuz i have done things like this since ever and it always worked except now.
Mostly logs, its hard to remote debug clients you don't have access to;
I'm using AGameModeBase, so SwapPlayerController should get called during seamlesstravel. I'm currently trying to reproduce this but its elusive.
Sorry for the delayed response, here is a clip to illustrate the issue.
Every 2 seconds the server updates a "score", you can see it blink the print as it updates the "score".
Once the score gets updated it tells the Game State to update an int, score is a float so its casting to an int.
The Weapon/Gun here is reading from the game state on tick to fetch the latest "score" as an int for display.
You can see when the score hits 1 on the top left from print and when the client sees the score update. There is an initial delay then as the score changes a few decimal points it seems to be updating ok?
https://gyazo.com/b7421cf96d6d6efa1a7328f70fae0030
The yellow text is Score : 60 seconds countdown.
And the Score Displayed on gun is made to be 2x the actual score, so hence the number is higher once displayed on gun
Took about 40 seconds to read a value change on game state, then it seems to update ok afterwards?
Yes when I made my own custom flag with "E" to climb, it all worked, but I wanted to combine them to save bandwidth. I fixed it in the end, needed to override
bool AMMOCharacter::CanJumpInternal_Implementation()```
And make sure my logic for climbing is not met and now it all works. ๐
ah nice!
are you allowed to struct NetSerialize pointers ?
is there any examples i can look at ? i tried googling and couldnt find anything
by ID you mean GetUniqueID() or that network guid thing
nvm, i can just call MyActor->Serialize(Ar)
Still having trouble with this. i should clarify that i'm a newb, and am trying to get 2 characters in one server together. My client can connect to server, and players can see eachother, but the connecting player always spawns with 2 players in one spot, and then starts floating up. if i use movement, it will just add to the players movement, but still continuously goes up and up. while this is happening, the server host can see the joined player floating away. 3 days now, i've been trying to get this right. i have no clue what to do.
I should probably add, that all my code is bluprint ( if that matters).
The units for the Stat Net command are bytes per second, right?
I was doing some tests that seem about correct according to my calculations. Sending an int16 consumes double bandwidth than int8, no matter that the represented number is the same or not ( I had the doubt whether it got optimized or not, answer is no)
It can't know that it doesn't need as much so yeah, it has to send all the bytes
If you really need the bandwidth you can do the (de)serialization manually for structs
Yeah, I was thinking about it, and reading about bit serialization. Since it seems that my bandwidth is still under acceptable limits, I'll just use int16 for now (enough for all the values I need to send). I'll maybe look into a more optimized approach if issues arise or have time to spend on it
Are you manually spawning the actors and if so, can you show the code how you're doing it?
Tbh I'm not sure. I've done a mix and match of tutorials, so of the top of my head, I'm not sure. If its possible, I could live stream my desktop so anyone that can help can see what I got going on.
Throw me a ping if this sounds okay. And let me know what the proper channel is to show in.
Not sure if this is what you mean by manually spawning, but is th eone you're asking about? @sinful tree
Heyyyyy My Client Player Cannot Move properly , and jitters while jumping only in mobile preview
Can someone tell me what is the logic behind keeping a PC after seamless travels if the PC class is the same? This causes PC's begin play events not to be called the second time over when the PC doesn't change.
https://github.com/EpicGames/UnrealEngine/blob/cdaec5b33ea5d332e51eee4e4866495c90442122/Engine/Source/Runtime/Engine/Private/GameMode.cpp#L408
the first pic is inside gamemode BP start player node. This second pic is also from inside gamemode BP and is the find player random player start node.
this is what the second player/ new joined player is seeing. For some reason, it is spawning 2 in one.
another odd thing, is that it is still taking the controller movement from the first player/host. so if i am host, the joined players controller is still moveing in coalition with host controllers. meaning, whatever way i move my motion controllers on host, the joined client's are controlled still by the host.
The same reason to why you would persist any other actor really.
Also in case of PC it's a bit different if say you want PCM to persist, then you want PC to persist
You could edit the vanilla code to not get the PCM get destroyed when PC gets destroyed though that could cause trouble down the line
It's not just PCM, also HUD and any other PC dependent actor you might want to persist
I want to log a variable with the server and client's same timestamp so I can check for a difference because of a net correction. Does anyone know how to get the time stamp and print it for the same one time with client/server?
Actually Iโd rather reset anything I donโt need persisted, like PCs. When I start a game I want to have a clean slate. I have a modified version of that code that just doesnโt check for class equality
what do you mean by print it for the same one time?
It's up to you, but there's nothing bad about persisting actors, sometimes it's needed
For PCs one could argue, and a good practice is to start fresh
Like 51.3 timestamp - what was x variable on client and server
Agreed, I was just surprised to have different behavior when restarting a game.
The easy way is just to have a new PC class inheriting from one shared PC parent
That way you don't override anything
Indeed thatโs a possible approach, Iโve just commented out the class check in a custom GameMode so that PCs always get recreated and swapped
something like this ?
or more specific?
Oh no, I see your question, you want to log different variable values over time, right?
Hey fellow devs i need some assistance,
So I am creating Goals inside GameMode Blueprint Class as shown which spawns the goals on the Server & Clients As The Actor is set to Replicate
However on the server the Goal ID is set upon creating the Goal but when I execute the code show in the 3rd picture it doesn't update the text for the client upon Event BeginPlay but it work if i set it inside Event Tick inside PlayerCharacter BP or Character Pawn
can you send images of the client code
I think the goals are being spawned right when your character asks for their ID
That's The ClientSide
probably true
So event tick will later grab the corrected ID which wasn't there when spawned
maybe add a delay of 2 secs just for testing
after BeginPlay
gotca will try that
ok yeah that works even with 1 sec
but doesn't Gamemode initialize before any other class?
is this inside the GM?
no the above is
Ok I can't see the pics above, can you send them again?
that is in character pawn or player character
sure
Yeah ok so, what is prob happening is, the goal and the char initiate at around the same time and can only change values after the GM is initialized
but the GM is initialized before any other class i thought
im guessing Event BeginPlay is initialized at the same time for all classes
Wasn't it second after GameInstance?
Yes, and that is when the spawning of the actor finishes
idk could be
ahh i see
I am not sure though too, and it doesn't really matter anyway
yeah true
So maybe the Pawn spawns after the Goals
Or the other way
yeah could find that out by debugging or something but oh well, appreciate the help
You too
Ok I just looked into it, it has to be some sort of setting I turned on/off , because when I ALT + F4 my one client standalone window the server gets disconnected too
So no BP errors, yaay ... ๐
Eh no that wasn't it either, that was actually a BP error, sorry guys. Misleading hope
How do I replicate a leader pose to other clients for montages? ๐ค
I'm using a character made a multiple pieces and I use a set leader pose to the mesh on begin play. This seems to work fine for both clients and works fine for blend tree animations but when I play a montage on viewing clients it will play the montage only on the base mesh and the rest of the pieces don't move.
Anyone ever had issues with SweepMultiByChannel using a capsule getting different results on a client vs server when calculating on tick component? Got some net corrections and pretty sure I've narrowed it down to this.
It was. And that was it
I'm having a hard time getting a client to connect to a session, and I boiled it down to a problem with World Partition, getting this in the logs:
[2022.12.18-23.02.51:886][915]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: EOS:0002c10456fd470a9ddb1ae5220de9ff:GameNetDriver:26, Name: IpConnection_0, Driver: GameNetDriver NetDriverEOS_0, IsServer: YES, PC: BP_WastelandPlayerController_C_1, Owner: BP_WastelandPlayerController_C_1, UniqueId: EOS:d11612ba83814c1cad2fa2b31d38d002|0002c10456fd470a9ddb1ae5220de9ff
[2022.12.18-23.02.51:900][916]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X-1_Y0_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X-1_Y0_DL0'
[2022.12.18-23.02.51:907][917]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y-1_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y-1_DL0'
[2022.12.18-23.02.51:912][917]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y0_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y0_DL0'```
I saw a bug report on 5.0 with a similar report, but it says fixed in 5.1, and I'm on 5.1... maybe I missed something regarding world partition and packaging?
(although in the packaged build it works just fine for the host)
Is anyone able to change the relative location of the character mesh on servers and clients? I think i hit a bug, since some people made a forum post about it, but i cant believe it since they used 4.9 and im using 4.27
Another thing I noticed is the client is not showing a prints string when joining. Only the server is showing the print string.
So its like the client joins, but not all the way... idk..
hello slackers
i wanted to ask about the ue pathfinding system in multiplayer real quick
using Character, do autonomous proxies on a client run their own A* ? or does the server run it only and send necessary path/velocity nodes
whats your connection string look like
I just figured out that it works with 2 packaged builds, just not with 1 packaged build + standalone launched from editor
When the client is asking the server to spawn a weapon, is that still happening on the player character actor? Just with an event set to Run on Server?
Is there free matchmaking servece for listen server that supports any platform with no limits ?
Hi everyone! I'm building a building a game from Lyra and I want to set up a multiplayer system, something like a "Social Verification" system. It would be a way of gaining some stat or achievement based on feedback from another player. So for example, player A claims something happened and player B knows about it, the machine sends a request to player B to verify the event happened. Player B verifies that it did happen, and if so, Player A gets points. What would be the easiest or most efficient way to get this done? Some general guidance would be great to get started.
event doesnt get called unless the player is "focused in window" so if the player alt tabs, the event wouldnt trigger, if the player doesnt alt tab then it works perfectly fine. curious if anyone had this happen before
its very similar to this thread's issue
Greetings, I have either run into a bug or some unfortunate piece of resource saving in the editor. First, Iโve made a partial ragdoll based on hit and ragdoll system that works flawlessly single player. However, in attempts to set proper replication Iโve had all kinds of trouble. Most I am happy to trouble shoot and fix myself, but my main is...
Does anyone know how to increase ping in PIE? Just want to test things out for the scenarios where there's lag over the network
Go to Editor preferences > Level Editor section -> Play > Multiplayer options section, Enable Network Emulation
Can also get there pretty quickly by clicking here
Ah, I somehow missed that
Thanks, it worked
Also cool note, you can use Get Ping in Milliseconds node to get the ping in ms
But this sucks, everything breaks down (on the Client) with "Average" latency preset, which is about 300ms ping
Advance apologies if this question triggers you lol.
Q: GameState, PlayerState, Pawn Character Classes run on Server & on Clients. Does that mean the code in these classes will execute each time for all the clients upon every new client connecting or it will only run on the new client's instance of the game.
Pawn Character Class
I am getting some linker errors when using FFastArraySerializer, since I am using a blank project, I'm not sure if I need to add any modules to the .uproject or .build.cs files in order to use it. RPCs worked well
Probably it's me not writing the array serializer code well, but just in case
It seems that adding "NetCore" and "NetCommon" did the trick
@winged badger sorry for pinging! I tested the FFastArraySerializer and it works very nicely, actually it seems to use less bandwidth than RPCing the array deltas directly ๐
But I wanted to ask, have you ever had problems with the update timing arrival on clients?
When I send the RPCs (which are sent every 100ms) I do a check that the arrival timing of the update is more or less 100 ms appart from the last update, otherwise there is the possibility that the update was late, and applying a movement update that is guaranteed to be late (so it represents an old position) is worse than not applying an update at all
(Iโm following bits of this large replication fast array stuff. Any chance of a blog about it when you finish Max? Seems like thereโs some good stuff coming together).
About the fast array serializer, there are already a couple good articles on how to use it, I was following along Vori's
Arh ok. Yeah Vori has some good stuff.
I will probs write something about the general replication for my RTS, but probs not very soon
i typically have the network managers on high priority high frequency, so it doesn't fight other actors for priority
I see, so it's not a problem and updates are "fresh" enough? Idk how time-sensitive yours are
I don't have the same issue for health or other attributes, but for positions the timing is kind of crucial
maybe I need to test before making any assumptions though
I just hit an issue where playerstate is not valid at beginplay. Is there any particular reason why that is the case? Also I assume adding delay node is not the smartest way to get around that, but polling for playerstate is only other thing that comes to mind and seems almost as bad as delay.
Use the virtual OnRep's
For the PS to be valid at Begin Play, both the PS and the actor referencing it must replicated before the game state does - of which there's no garauntee
Where are you accessing it from?
I'm accessing it from in gamemode from GameState's PS array
From what I gather from testing the fast array serializer, the PostReplicatedChange function gets called in all the structs that have been marked dirty at the same time
Yeah, it's done in a loop during the replication update
GameStates PS Array can only contain valid player states, because they add themselves when they replicate
Essentially what happens is:
player enters a match,
his HUD constructs a widget
widget populates itself OnConstruct with data from PS array
Widget doesn't really populate itself because the PS doesn't contain valid information yet
I added a delay node between on construct and populating the widget with data to make it work
but it feels horribly wrong and is a subject to immediate refactoring
I think I'll be using RPCs instead of FFastArraySerializer nontheless, after a bit more testing I saw that the serializer has a ~25% package size increase to replicate the same data
my spidey sense is tinglin'
I want to be able to add replicated properties from lua.. Is it possible to lazily register a property to replication framework instead of GetLifetimeReplicatedProps?
GetLifetimeReplicatedProps
is there any non lifetime method?
negativeismo
They're part of the class data
So unless you can serialize it into the class...
thats what I thought ๐ sad..
this will require me to create a c++ or BP base class for each lua table whenever I want to have a replicated property
how much
it is?
I don't honestly think it's feasible, you could try poking around FRepLayout::CreateFromClass
roger, thanks
anything to avoid slow BP loops without converting every script to CPP at this point
I know, stateful stuff should be replicated, not RPCd... but I don't plan to support late join (or not soon) and RPCs give me more control over the synchronization of positions
If it was not for the bandwidth increase I'd change it
Is there anything in UE5 regarding Movement Replication of Characters, that changed that could cause something that previously didn't have corrections, to now haev corrections?
I coded a simple "Upwards Boost while holding SHIFT" with the proper saved moves etc. and it works without corrections on high FPS and 100+ Ping without problems.
In UE5 it has random corrections
:<
are you simulating any packet loss? that will cause corrections even with the proper cmc setup
what's a good place to get the playercontroller while it still holds a Pawn when the player disconnects? I tried Logout() but at that point the controller has no pawn
ok that's strange, inspecting a bit the code there, it seems the PC has an "AcknolowdgedPawn" that seems to be correct, yet Pawn == nullptr
what's the deal with the AckPawn ?
ok I just found something that might help; APlayerController::PawnLeavingGame
I don't think so. Client is testing this. I will ask them
Maybe the packageloss setting is on in UE5 but wasn't in UE4 >.>
Yop that's a good place
thanks! got it to work using that method
i keep getting the following warning on my compiled server console:
[2022.12.19-17.38.54:737][525]LogScript: Warning: Script Msg: No world was found for object (/Game/FirstPerson/CoreObjects/CoreBlueprints/LobbyPlayerControllerBP.Default__LobbyPlayerControllerBP_C) passed in to UEngine::GetWorldFromContextObject().
the thing is the game mode is not even using that PC
why would it be even throw that warning im a bit confused
I'm also using EOS if that makes a difference. Could this be done with a lobby or party and something similar to a chat system?
what is lyra? loobies and parties are usualy temporary things, depends on what you want to build u need to be more specific
Lyra is the sample game that was introduced with 5.0.. It implements the GAS and other features out of the box that I think would be useful for this. I want to build a system that allows one player (player A) to request verification for something from another player (player B). Then based on that verification points get awarded or not to player A. Example: Player A has wants to get points (in the game) for eating 10 hotdogs at the party last week (in real life). Player makes claim this happens in game but needs verification in game. To get this he sends request to Player B (also at said party) to verify.
hi all, im profiling sending procedural levels to clients via a listen server connection by replicating the actors, I dont quite have an intuition on how much bandwidth is too much, could anyone eyeball this graph and let me know how it looks?
thanks
also how do I check cpu cycle usage for replication? I'm not seeing anything obvious in the gamethread traces
How do you access this net profiler? I'm interested ^^
I think 8000bits doesn't sound crazy but idk in how much time, what is the unit in the X axis?
What I found is that having many actor channels opened is really bad, if you need high numbers I'd consider using a manager actor
I was replicating around 9600 bits 10 times per second for some testing and iirc was ok
x axis is packet index, doesnt seem to be even time interval each packet ranges between .01 to .03 seconds from previous packet
if it is a one-time event I guess it's ok (at the end of the day, you just need to test your game in real conditions and see what happens and if it's acceptable)
OMG please let this be the case, I've been scratching my head on this exact same issue for a while now. Hopefully there's just some engine changes going on and things will return to normal "soon".
well ur probably gonna need to keep that info with the players, thats a very specific case, unreal servers dont hold info like that since they are only temporary sessions and if ur gonna keep that info u might aswell just use some backend server, if you cant do that, u might be able to store the info with the players on a savedGame class but thats gonna open a can of worms with security
Not sure yet. Will have to look into it tomorrow
Looking forward to it
Anyone ever had net corrections where you enter a custom movement mode (e.g climbing on wall) and then exit it and the client thinks it should jump, so as you see by the red capsule it starts jumping and then the server corrects it to say it shouldn't have jumped. Did not click spacebar to jump Only "E" + facing wall to enter climb and "E" to exit climb. Just running at a wall, clicking e to enter climb and e to exit and walking backwards. This is with 500 ping, but trying to understand it
Can I ask what networked vehicle physics you purchased off the marketplace?
Hey thanks @limber gyro. It feels like between the Lyra GAS and Gameplay Message Implementation used together with EOS I can pull this together pretty easily just haven't figured out how to yet.
do you mean Is Locally COntrolled?
Hello,
Got a question regarding issues I'm seeing since I upgraded my project to 5.1. Did not have these issues in 5.0.3.
Anyone else having issues with the Open Level By name (Or object ref) not working anymore?
And the basic Join Session node not opening the Sessions map anymore for the connecting client on initial connection? (Perhaps also due to behind the scenes issues with Opening Levels?)
If you experience something similar or know a fix please let me know
The current workaround for this is to build your project as Development, And do not use Steam Sockets if you are using Steam
https://forums.unrealengine.com/t/need-help-with-steam-sockets/604911/6?u=danialkama
whenever modifying something in the editor, should i package the server again?
Not necessarily, but ultimately probably not a bad idea
There are some things that could be Client only, like UI, that wouldn't need the Server to be repackaged.
Not sure if the Build Version changes and breaks being able to join though.
when im casting a reference to self in a game state then what am i casting a reference to? the client that called an event or the server or each and every client in the level?
Casting a reference to self; what?
--
I dislike the CMC more and more. Noticed that when chaning MaxJumpCount and receiving a Correction, it can be that the local value is overridden back to the previous value.
Also the CMC just doesn't allow to patch up SavedMoves. A SavedMove doesn't need to be the truth...
Eg. 50 SavedMoves, all say "You aren't stunned.". Now you get a correction cause you were Stunned, already 25 of those SavedMoves you should have been Stunned.
When replaying the first 25 it's fine, when replaying the second 25 it acts as it's not Stunned (cause that was saved).
Overwatch patches the SavedMoves if something like this happens.
Still not quite sure how MaxJumpCount resets back.
All SavedMoves are played in the same frame, so either the MaxJumpCount got set to 2 (back from 0) before or after that.
If before, it will be saved, then Moves will replayed, then it will be restored, to not override the current value.
So 2 would still be correct after.
If after, there should be nothing overriding it.
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Server: 2
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 0
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Server: 2
LogTemp: Error: [UVRTCharacterMovementComponent::ClientHandleMoveResponse] Client Received Correction.
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 2 // Set from RepNotify
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 0 // ???
After that, Server is 2, Client stays 0. Lovely
Maybe I should just let it replicate and undo this from ACharacter DISABLE_REPLICATED_PROPERTY(ACharacter, JumpMaxCount);
uerm when i go into the game state and lets say do anything in an event or anything and in 'target' i give self"
That simply refers to the current instance that is calling the code
so the calling client?
No
It has no Multiplayer Concept
When you stand in a room with multiple people and you can command them to jump, then "self" would be you commanding yourself
That has nothing to do with multiplayer
Also the Target pin usually defaults to Self
At least for functions of that same class
that makes sense; although i still dont understand then;
if i say jump
and im supposed to jump
do i really jump?
that sounds so dumb
Don't apply network logic to it though
okay
Like the GameState exists on everyone
ah
Everyone has their own instance of it
seperately
Yes
so "self" when called on the Client 1, is the Instance of the GameState of Client 1
Same for Server, and Client 2 to 100000
Not sure how that is connected to Widgets, so I don't want to say yes or no if it further confuses you
it's the same concept for any object
they exist on every client seperately
Multiplayer is just having a Room, but it exists once per Player.
yee
If you draw it you'd draw one per player
And some Actors exist in every room, others only in some
GameMode would only be in the Server Room
Widgets only in the Client rooms
Some of those Actors are connected across the rooms
Being replicated
Yus
it all makes more sense now though, thanks
i was confused as to why there was a "self" option and i could cast it as reference and what it meant so had to ask ๐
... This doesn't help either.
OH MY GOD
I hate that CMC has no proper function overrides for 90% of its sh*t. There is code duplicated to be able to inject stuff and it obviously changed durign Engine update
Yeah CMC is nightmare to work with ๐
Shame they never completed the other one.
NetworkPrediction one?
Maybe?
They are more likely to make an entirely new class like NP.
Changing CMC behaviour would fuck over a lot of existing code.
that is true, damn thing remember Unreal Tournament better that anything else
When testing dedicated server / client in the editor is "Run under one process" always be unticked... I always have different behaviours :/
Yeah. It's not a good idea to test it in a single process. It's just not a "production" environment.
Unless you're testing the absolute most basic of things.
To test Coop / player 1 host player 2 .... I should start 2 as listen server without run under one process ?
Yeah.
ok thanks @latent heart
The only thing I noticed so far is that unlocking FPS on the client and going to like 120 breaks stuff
Not sure why though. Can't I just do Value -= DeltaTime; in PerformMovement and be fine?
Still baffles me that speedhack detection is disabled by default ๐
I have for years believed it was on. More fool me..
Sorry what
Oh yes
AGameNetworkManager:
bMovementTimeDiscrepancyResolution = false;```
(And no it's not overridden in a config anywhere)
;-;
But it's okay just set the -deterministic flag and literally the entire game will speedhack anyway 
Still reeling from this weeks discoveries
What does -deterministic do?
Forces the engine to run in fixed timestep mode, which as I discovered earlier this week is a shambles
Ah. Yeah that was a very heavy WIP last time I checked lol.
TL;DR, the engine might be running at say 60 FPS - but every value of delta time will be for 30FPS, so the entire game simulation runs faster
But ofc - that incredibly low-level decision is easily exposed to end users in the form of a command line flag ๐คท
gotta go fast
I would really love to know why a simple "reduce value over time" logic in PerformMovement breaks at higher FPS
IIRC the saved move buffer isn't large enough by default to handle high frame rates, especially if you have moves that can't be combined
But that's not even the issue
It looks like the Server is literally consuming the value slower or so
Or faster?
Is there like a min DeltaTime value that the Server calculates
I'm confused
I think there is a min time where it'll just skip a frame or something, but server calculates delta time IIRC as a rolling average across many packets
Also can't seem to reprouce this in the editor with the same fps
Delta on server is more like TimeSinceLastPacket
Hey there, so I have an interface "Get character infos" on my character...On this same character I have an actor component trying to add skills and calling get character infos from which I try to get a Struct Array from a DataAsset specifified in a variable on the character class..
Suprise, if I run in "separate server" + untick "run under one process" and run as client .. it will always be printing 0 event if the DataAsset is valid.
I might miss something easy somewhere ๐
But then fudged IIRC to sort of closely match the clients sent delta I think
Can't remember the specifics now..
But I can't really force Clients to have 60 fps
That's a little bit outdate with todays monitor refreshrates
Apparently, based on Client (work), 120 FPS were just fine, without any code changes since the update to 5.1
In UE5, packaged high FPS build starts behaving really weird in terms of movement
Which makes me believe the broke the CMC somewhere
Even more than it already is
Maybe it's related to the changes to world time?
If it wouldn't be a package only problem, I would be quicker in debugging -.-
Ah not sure in that case
At least I can't recreate it in Editor. Trying standalone atm
In some way it's kind of funny that the Character system has so much to it to cover a lot of use cases but at the same time is so complex that not many know how to properly adjust it and might as well not use half of the functionality ๐
when I have a Client connecting to a Server, how do I override the Player Name that will be sent? I tried adding ?Name=MyName as a param to the URL for ClientTravel, but when the server spawns the local player, it uses the default ?Name= param (which is the computer's name at least during the editor)
What in the actual f
t.maxfps 60 or lower -> all fine
t.maxfps 61 or higher -> breaks
What is going on with UE5
I don't even know what breaks
Like, there is a float that gets reduced as long as you fall and hold SHIFT.
That is implemented like any other CMC extended movement.
The float value reduces visibly fine in the UI when on 60 or lower fps
Higher and the bar stutters and I get corrections
This is even on the same PC, so basically no ping or package loss
Thanks, however I do need the Steam sockets since Steam Net Drivers are pretty old and outdated. Not all functionality works with them. And I see that this fix does not work in a shipping build so technically unusable then...
Does it work for you like that in a shipping build?
Kind regards,
Kekdot
UE 5.1 is broken in all kind of unexplainable ways currently... I'm going back to 5.0.3 for now
Not even sure if that's 5.1
So the following is going on:
Steam Multiplayer is broken in 5.1, there is a workaround if you're using a source built version of the engine, see the details below:
There are console commands that disable SessionId/ClientId checking but they are broken since they implemented the console commands incorrectly, a pull request is created here:
https://github.com/EpicGames/UnrealEngine/pull/9857/commits/3623560408b7a98049c0e8c2a0bf438c777139c5
If you merge the pull request you can then use the console commands:
net.VerifyNetClientID 0
net.VerifyNetSessionID 0
To disable the Client/SessionId verification.
To make it permanent change these two variables to 0:
static int32 GVerifyNetSessionID = 0;
static int32 GVerifyNetClientID = 0;
in file:
StatelessConnectHandlerComponent.cpp
OOF
i has issues with my server thinking a pawn was an autonomous proxy by my clients thinking it was simulated
turns out i forgot to call super dolifetimerep
this is hard
[2022.12.20-16.34.34:011][962]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.032776
[2022.12.20-16.34.34:028][963]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.016388
[2022.12.20-16.34.34:044][964]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.032776
As soon as I hold SHIFT on > 60 FPS, the Client prints different values for DeltaTime in PerformMovement
asdaskjdalsdjasld xD what is this
I'm not even performing the movement code. I just hold SHIFT on the floor (which fails to activate the boost I coded cause you can only do that in air)
<= 60 FPS it's fine. > 60 FPS it prints different values in log
CMC does have some min tick variables and magic numbers potentially floating around, but 60fps is like .016 right? it shouldn't be triggering any of that...
Yeah but, it prints both
oh duh true
Like, the Client prints DeltaTime correct and then like twice as high
And the ncorrect again
Which explains the lagging
Also it only happens if I hold shift
Have to research why
Shift is just "bWantsToBoost"
Hello, I'm trying to make my first multiplayer game on unreal. However, when more than 2 players join my lobby and I start the game, all clients are disconnected. Do you have an idea?
are you playing as client or listen server?
I launch my games as standalone(Client i guess) and I host the session on one of them
Clients can connect to the lobby but when I run the game with more than 2 players, nothing works.
Is this using any Subsystem like Steam?
And are you (correctly) using SeamlessTravel for your ServerTravel of Lobby and Gameplay GameModes?
I use the Null subsystem but I dont know if i use the serverTravel correctly. 3 players can join the lobby
but if i start the game, the game restart for my clients
ok i turned on seamless travel in the gamemode and its ok
We built a project with many different configurations and only Development with Steam Socket disabled works currently.
Have any of you guys experimented with the Unity Multiplay for Unreal?
Hey smart people. So I'm trying to get my weapon swapping system to work in multiplayer and so far I'm getting really strange, mixed results. I spawn 4 weapons actors on begin play for my character. I attach 2 to my FPS arms mesh and 2 to my TPS mesh. I then set the visibility for each one on the server, then I run a client and a multicast on the server RPC which sets the appropriate visibilities. But still it's all screwed up. Can someone see from this pastebin what I'm doing wrong?
So I think my issue is:
// Decide whether to hold off on move
const float NetMoveDelta = FMath::Clamp(GetClientNetSendDeltaTime(PC, ClientData, NewMovePtr), 1.f/120.f, 1.f/5.f);
if ((MyWorld->TimeSeconds - ClientData->ClientUpdateTime) * MyWorld->GetWorldSettings()->GetEffectiveTimeDilation() < NetMoveDelta)
{
// Delay sending this move.
ClientData->PendingMove = NewMovePtr;
return;
}
I'm just confused why that isn't an issue in UE4
NetMoveDelta is exactly 1 / 60
So higher FPS mean we are sending too often and it tries to combine this move with the next one
Not sure how I'm supposed to handle that for a boost atm, but it's probably just part of combining the savedmove properly
Or increasing the value cause it's only 4 players
It's networking - it gets there when it gets there.
Could be in like 6ms or 600ms
It doesn't work different. Networking calls isn't 100% predictable.
But the RPC can't be processed until the packet gets there
If client sends something to server, and it takes 6ms to send the packet to the server, then the server will process the RPC 6ms after the client sent it
To my knowledge, RPCs aren't processed in Tick. They are processed the moment they are received.
This actually makes sense if your float deltatime values are always double. Aside from the savedmove list, CMC always keeps one pending move that it potentially combines with the currently ticking saved move? i was looking at that this week
Uh exi there is a bForceNoCombine
Cause all I have in my Move is the saved boolean
Yeah I know, but why would I need to force
It already checks the flags
If the flags don't much it doesn't combine
And everything after starting my boost is just running on "tick"
I'm not sure why this would fail
Oh I think cmc tends to lean towards combining moves if the delta between them (physically and time wise) are small enough, maybe 60fps was the threshold and was causing issues with the boost
What I don't get is why this matters for me
It won't combine the two moves when the Player starts pressing the key
There is no data in the Move despite that boolean
So nothing I have to combine
In theory, after pressign the button, all that happens is a float being reduced by delta time in PerformMovement
And a combined delta time should be fine
Not as smooth but that can be smoothed in the UI fwiw
PerformMovement(NewMove->DeltaTime);
This happens after combining
So that should be the correct, double DeltaTime for the local client
Now the Server has to do the same
Mhmm, it grabs it via the saved move list, then does a combo, then perform movement then postupdate the savedmove
..
Did they go from the old ServerMove to the new ServerMovePacked between 4 and UE5?
Like as a default
Maybe there is a bug in there somewhere
Yeah, there is a new boolean but the old server move is backwards compay
Let's for fun turn that off, shall we
Itโs use server packed rpcs, you can specify it and it will either use the new or old functions
I think so ye
Doesn't seem to help, so no bug there
I have an InventoryComponent that's attached to each player's Controller, but after rereading the compendium I thought it would be better on the PlayerState. Then I realized in both cases each client has authority on their own inventory, which opens the door to manipulation. Is that correct? I probably should put the inventories somewhere else that's owned by the server, right?
Doesn't matter. Just always verify stuff on the server before important stuff happens
They can say they have the BFG in their inventory all they want. If it doesn't exist on the server, then they're lying
Yeah.. each item is it's own UObject, so I could track what the authoritative "container" for that item is on the server, and add checks before equipping/using/consuming/etc. and item that the "container" is accessible to the player
When the client picks up an item - you should be asking the server to pick it up anyway. Which then gets replicated back to the client.
I don't even do those checks personally. I just check, on the client side, if I have the item. Then I ask the server to equip/use the item for me. The server then does the same process pretty much. If it doesn't exist on the server though, it is questionable behavior.
Hello I have small problem in my game demo, I did eos login and eos sessions and joining to them buuut when I tried change my actors/ thirpersoncharacters with my PlanePawns /child of pawn from my second project I donยดt see each other in game like it was not replicated I will add also screens and logs if it can help thank you for any tips :)here are all screens
So main problem is that I dont see pawns in my map
like they are not joined on server
Hmmm... maybe I'm thinking about this in the wrong way. So what if I just spawn one actor for the player's currently equipped item. I attach it to the First Person mesh for the client but for everyone else, I attach it to the Third Person mesh. Is that something that would be simple to do? Like call an attachment RPC on server, pass the correct actor and mesh, then call a multicast RPC and run Attach Actor To Component in the multicast?
I forgot to say thanks earlier, so thanks!
But also, follow up question - how do you handle firing the pickup from the server? Right now I have a PickupComponent on the Pawn that detects nearby items and fires the pickup... but isn't that also owned by the client? Should my Pawn's PickupComponent ask the Item (owned by the server) to add itself to the Inventory? That feels convoluted but also correct...
I just have a interaction box on my player. When it crosses something else that has it (only triggered by one thing, has its own custom channel), it becomes the TargetedInteractionObject.
When I press the interaction button, it checks that it is valid and then does a server RPC with the interaction object as the argument
At this point, someone can cheat. But it is a co-op game in my case, so I don't care.
The server then validates that this action is legal (simple distance and facing check honestly). Then picks it up and adds it to the inventory. Which then replicates back to the client that it was added.
Cheat away my friends. Cheat to your hearts content. I don't care.
I just do super basic validation, just for game balance reasons. The bad actors are going to figure out how to hack my stuff anyway.
I never really got on board with the whole interaction/pickup stuff being component based. Still interface based for me.
This is making sense. I guess I'll add the RPC on my PlayerController, something like "RequestAddToInventory(itemToAdd, thisControllersInventoryComponent)", which the PickupComponent calls
I'm a huge fan of composition over inheritance when I can, but the requirement that I need the RPC on an actor and can't do it from a component owned by a replicated actor adds bottlenecks like this...
Why does the widget only show up for the server and not the client?
This code is in the gamestatebase
It's not a client rpc
Why does it need to be multicast tho
You're iterating through the player array and calling a function. That function is not a client rpc so the client is not told to do anything
You're just calling that function on the server
If you want everyone to hear the sound, yeah. Otherwise you can make it so only a specific player hears it.
I meant specifically for the widget
So I've been dealing with this issue for a while and I can't find a way to fix it
I have a game about aircraft dogfights, they move really fast, so ping is a big issue. When they fire their guns, if i fire them from the server in order for them to be properly replicated, the time it takes for them to be spawned in the server seems to be enough for the location of the client to change, so clients will see their guns firing from the wrong place, with a delayed rotation
https://gfycat.com/livelyfearfulequestrian
As you can see, it's absolutely game breaking
What i've been doing is guessing the future position of the client based on their current velocity and angular velocity, but this solution, while better than nothing, is deeply flawed as when doing several quick and short turns the game will shoot in a future position that will never be reached, which will give the weapons an absurd "spread cone"
https://gfycat.com/tenderrichfinch
These movements just happen to be exactly the kind of movements a player will do when adjusting their aim so, while playable, it harms the client experience a lot, as in a game like this that spread can make it very frustrating to hit a target
So my question would be, is there a better way to do this? Can I somehow spawn the bullet from the client itself and then replicate it to the others, giving the client full authority? Hacking isn't a concern to me and this keeps harming the experience of most players
they are their own actors with static meshes
I can send a picture of the blueprint if that doesn't answer the question, i'm a little unfamiliar with the terms to define these things
So each bullet is an actor being spawned server side, bug lag delay makes it feel broken. Is that right so far?
You can use net startup actors to spawn something on the client and then link it to a server-controlled actor later (see https://vorixo.github.io/devtricks/procgen/ for an example, ignore that it's about procgen, concepts are the same).
Or you can manage things yourself - spawn an actor on the client, delete it once the server spawns its own actor and reconcile positions. Or hide the server actor entirely on the client that fired things.
Yes, the client tells the server to spawn it and gives it a location, then the ping makes it spawn a few milliseconds later, which is enough for the aim to be badly affected
I had a similar shooting system for one of my enemies with my game and I switched from projectiles to using line traces + niagara effects. This way the particle effects can be spawned client side and multicastsed for others to see (with lag delay) but since the line trace is what actually handles the hit and damage logic it happens on the server without any visuals.
I think what's mostly done to make this look and feel a bit better is to have the Client be the Auth on the Projectile.
As in, the Server is the one calculating where the Client's projectile should be
Not other way round
You still have to deal with general ping of shooting at RTT ghosts
Or RTT/2 fwiw
But that's the internet
UT does this iirc for their slower moving projectiles
Just read through their code a bit
Wouldn't work here because in a spaceship setting with low-speed projectiles like this one leading the target is a big factor, which I assume wouldn't be doable with line traces.
Could you elaborate a little?
I mean you can simulate a projectile with multiple traces over multiple frames
I'm now facing this issue and I'm experimenting with dynamic delays based on distance of the hit.
But that's just theory
This feels like it could work if I managed to code something like that
Right. You'd still need to extrapolate projectile travel time on the server.
Well the idea is that the Client fire the projectile instantly, locally. The Server fires it after the RPC (however you do the firing) arrives. But the Server will spawn it "backwards" in time, basically.
But I'm still a novice so I'm not sure if my approach is gonna work or not...
Again, UT should be doing this for Rockets
I still don't underestand
Also, what is UT?
UTs source code, even if old, can be studied
Unreal Tournament
It's on GitHub along side UE's source code
You can just read through it
Client spawns an actor that isn't "real" and is just for visuals. It also tells the server it wants to fire a projectile. Server spawns the projectile, but instead of spawning it at the gun's barrel or w/e, it spawns it a bit ahead based on the client's ping.
i have done exactly that for my hoverboard game but it was with blueprints. the client had full authority
There will need to be some additional checks to see if the client hit something directly in front of them but that can be done with a simple trace.
Also you'll want to limit the amount that ping can affect this so clients can't just shoot infinitely fast projectiles.
So with this approach, what about the check to ensure the player is allowed to fire (ammo, energy...etc) shouldn't that be handled on the server to prevent cheating? But then it introduces input lag.
You need to trace the distance between Barrel and new spawnpoint
In case there was something really close
But despite that, it should work quite fine
On the Server that is
Just test on both sides?
Mine is with blueprints too, i just don't know how to give the client authority as if i spawn actors from clients they just don't show up in the server or other clients
The Client projectile is only visuals
Sounds like the same kind of extrapolation i'm doing but with fake bullets to hide it
well, i do, and its rather simple.
Probably
And it's generally how this sort of thing is solved
Most (if not all) server-authoritative shooters will do this
"What you don't know can't hurt you"? xD
ahh okay so I do the ammo check locally for honest players to show vfx client side and only cheaters would see infinite rocket vfx as they cheat to skip the ammo check, but server side only max ammo of rockets was actually fired.
the clients will have full authority though so you will have to run checks
Again:
- Spawn Projectile, non-replicated, on Client
- Spawn Projectile, replicated, on Server
2.1. Take Ping into Account and calculate how far the Client's projectile already travelled until the "ServerRPC_FireWeapon" arrived.
2.2. Spawn Projectile at the new Location (which is further away from the Barrel).
2.3. Trace from Barrel to new Spawn Location to ensure nothing was in between. - Once the Server projectile replicates to the Client you can delete the Client one.
They should theoretically match up. And if not you can still interp the fake one to it.
Locating the fake one is the only tricky part if you have no setup for it.
UT finds it based on distance comparison (ugly).
We, using GAS, just send a prediction key along.
like if you can figure out this approach its better
Great talk on techniques for prediction, if you haven't seen it. May give you some more ideas to handle projectiles and other things. Somewhat technical/advanced, but that's kind of inherent to networking.
https://youtu.be/h47zZrqjgLc
In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking.
Register for GDC: http://ubm.io/2gk5KTU
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://twitter.com/Official_GDC
GDC talks cover a range of developmental topics including game des...
They go over some of this stuff when talking about grenades.
What kind of checks? I'd be interested in knowing how to do this
Also keep in mind that if you are starting to need Multiplayer Improvements like these, you might hit the end of Blueprints really fast.
This is very useful thank you
C++ is a must at some point.
--
On another note I'm still debugging my Movement Component with >= 61 FPS.
It causes the Client to try to combine most moves if not sending to reduce bandwidth.
It causes issues in my code though and I started printing in PerformMovement.
It seems like the Server gets all the combined move (double as high DeltaTime), which is good, but the Client prints once for the Combined and once for the normal Move, which seems wrong. It basically ticks a move 1.5 times?
heavily depends on your game, and the thing is you will se past versions of your enemy, so if you register hits this way its possibly even more broken. i had it for movement in a racing game which was basically what i needed and the clients wont interact with each other. you are looking for a hybrid solution like the one @thin stratus is suggesting
LogTemp: Warning: [CLIENT] [73.982254] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [73.998650] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.015045] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.031441] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.047836] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.064232] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.080627] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.097023] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.113419] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.129814] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.146210] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.162605] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.179001] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.195396] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.211792] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [73.982254] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.015045] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.047836] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.080627] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.113419] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.146210] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.179001] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.211792] [::PerformMovement] 0.032791
I feel like something is really off with the CMC in UE5(.1?)
not sure its impossible to pull a working solution only using blueprints, but knowing c++ will make it easier
I think giving the client full authority to spawn replicated projectiles would definitely fix that problem fully for me, since i don't mind the other clients or server seeing the bullets a little desynced, it won't be noticeable as they won't be their own bullets
How do you do that, though? or am I misunderestanding?
the thing is if you are killing a client on your end, on their end they see you shooting behind them
and then they die
the best way would be doing a hybrid solution when you display the bullets for the client as they should show, replicate other clients in a mediocrely predictive manner, and register hits based on logic that takes into account the player's ping and what happened first
unless you dont have any regards for a pvp scenario feeling right
I definitely do, it does sound like what i'd want is some kind of hybrid scenario like that, i just lack the skills to make it happen
If you don't mind explaining a bit, why would client bullets not hit the other clients on their screens?
visually they wont. if you are sending over information purely from the clients game instance, it will take time for it to rach other clients, and they will see their current version of their pawn that they have full authority on against your pawn in the past (how fast back depends on ping)
shooting included
because these are slow and predictive aircrafts of sorts, you can get away with mild predictability of the movement, and then try and register hits based on clients local perspective, and patch the bullet paths up on the server for other clients
if a client hit a plane, then you just show on the server a bullet that hits the other plane so that it makes sense
you dont need to follow any ground truth cause you cant anyways
I think I'm going to try this one, as I'm starting to underestand it, I believe
What we've been doing is predicting the firing location, which doesn't work because the ship changes course, predicting the bullet location should be easily doable as it doesn't change course
and on top of that it'd feel a lot better as the clients would see their own bullets so it wouldn't feel broken as it does now
Thanks to everyone for the help. Wish me luck ^^
you know you can filter out the replication so it doesnt go back to the owning client right?
like you can have the clients live in their own bubble of sorts and have the server patch thigns up for everyone
either way much luck
anyone help with this ? why my pawns are not visible for each other in session?
and actors yes?
So from what I can see, UE first checks if it can Combine the NewMove with a PendingMove.
If so it does and then Perfoms the move before sending it.
If it doesn't combine, it will check if it can hold off sending the NewMove and putting it into PendingMove.
But the result of that seems to be that UE Performs Move 1, then puts it into Pending Move. Then Checks if it can combine Move 1 and Move 2. And if so puts it into one Move and Performs Move 1 + 2, performing Move 1 twice.
What the...
Guess that's for tomorrow..
Is your Pawn marked as Replicated? :P
I believe yes but I posted logs above maybe my mistake is in session but people in #epic-online-services sent me here and people here sent me there and noone was able to answer so I am little sad and also I tried run my map as 2x client + server on editor side and I saw my pawns but when I tried join my sessions with pawns I didnt see them and if I change pawns to actors(thirdpersoncharacter) I see them also in session and also in editor when I run it as 2x client
weird really werid
weird I dont know what to do
That's a strange combination
Are you sure you are on the same server when the pawns are not visible?
Or connected at all fwiw?
I didn't have the time to check the logs you posted, sorry
yes it is strange I dont understand I can repost one of the log when pawns are in
it is this
both are for one of joined
on the top you can see they will find lobby and then join
(logs for characters are almost identical)
Do you have an idea for an algorithm to transform a session id into an id that a player can use to join a session
why ? eos has functions for it
Ok. guys I'm in over my head unfortunately. I've tried to change everything since posting earlier. I need to buckle down and internalize exactly how replication works. I thought I had but I am obviously wrong. What I'm trying to do is just a simple weapon swapping system for my multiplayer game.
When a player hits the 1 key it calls a server RPC which spawns a melee weapon. So good so far. Both the Server and all Clients see the spawn.
Then the server RPC calls a multicast RPC to attach the spawned weapon to the third person mesh, so that all clients see it in the hand of the visible mesh for them. Then I call a client RPC to attach the spawned weapon to the FPS mesh so that the player sees it attached to his/her player's FPS hand.
This works on the server but not on the clients so I am very lost as to what I'm doing wrong.
If someone can take a few minutes to look at this pastebin BP and tell me where my logic is flawed, I would greatly appreciate it.
u dont need transform anything
Hum ? I'm on the null subsystem now can i use it ?
hmmm i mean null does have it too , doesnt?
Using RPCs in this case isnt ideal, since they are not stateful, an incoming player that joins after the Weapon is spawned would never be able to receive the RPCs to do the attachment.
Its better instead to set the Weapon as a Replicated variable, using OnRep_CurrentWeapon to perform the attachments.
I'll will check, because a 32 characters code to join a game is not so great
try repnotify
why u not using eos?
I am still in local testing
also check pinned messsages here very useful articles there
may help you
Thanks
Ok. So I'll need to dig into repnotify to make sure I'm understanding it correctly, but basically, I set my CurrentlyHeldItem to RepNotify and then in the OnRep_CurrentlyHeldObject function, I'll check for authority and attach to the correct mesh based on authority/remote?
You probably want to do the attachment in all cases.
What if you decide you want to support Listen Servers?
The Host is the Server but is also a Player, so not doing the attachment for the Authority would mean the Host doesnt see it.
Keep in mind that if you are using C++ the OnReps must be called manually for the Server
Ok yeah this is just due to my lack of understanding. I'm using a listen server model and I want to attach the spawned actor to a different mesh depending if they are the server or client basically.
ser can I ask one question? are pawns and actors equal in unreal engine regarding to replication?
just to know if issue is on my side or on side of ue
when I have problems with pawns in mp
thanks
Well you can easily manage that sure.
What do you mean exactly?
A Pawn is an Actor
I mean when I join my session with 2 players both have parent class actor and its ThirdPersonCharacter I am there with friend and see each other, When I do same but I change actor to Pawn and put plane on it I join session and I dont see anyone
we are both alone there
I know Actor is child of Pawn thats why its weird to me
I am trying to solve this problem few days
Pawn is a child of Actor.
Not the other way around.
The ThirdPersonCharacter is also a type of Pawn.
Actor -> Pawn -> Character -> ThirdPersonCharacter
ok. hmmm.. So instead of using Switch Has Authority, I could use IsServer with a branch and then assign the RepNotify Variable to the correct mesh. Then in the OnRepNotify function is where I do the attachment.
here I changed to Actor and it was suddenly working. /sorry for big images.
ah I dont understand then what is the problem
with those planes
Sure go for it.
@real ridge Are they set to Replicate?
Lol. Thanks. I'll try it.
then for mesh it was unticked but when I ticked nothing changed
so I am lost tbh
How are you spawning them?
I cant use actor class for plane ... I cant make flying to work there.
I just have spawn point on map.
nothing more.
So its set as the DefaultPawn in the GameMode?
*player start
yes when I want thirdpersoncharacter I change DefaultPawn = ThirdPersonCharacter, when I want plane I change it to PlanePawn
and build server + client
and test
here
but its strange because when I test it like run 2 instances in editor for example and I use this setup
i see normaly both pawns in game
What are the render settings for PoseableMesh?
it is this, right?
but it does not make sense that when I use editorยดs server and run 2 clients i can see pawns in game but when I join my dedicated server session i dont but for actor i do
its not logical
Ok so I can get the spawn on server working just fine and OnRepNotify to attach the actor but I'm still not sure how to change which mesh to attach it to based on whether it is itself or other clients without using multicast/client rpc's
ueditor isnt tru representation of networked flow unfortunately
Within the gamestatebase, how do I play a widget on all players in the lobby?
I use event dispatchers to notify the player controller when certain things happen during gameplay that occur on the GameState. My player controller has a reference to the GameState on EventBeginPlay and binds to those dispatched events to do things such as displaying a widget for the owning client player when the match ends.
The idea being that if you're setting an OnRep variable on a specific character, then that OnRep would be happening on that character. So when a client receives the OnRep on that character, you'd have it do whatever it needs to do with the new value on that character.
Right. The way it's set up right now is that it spawns the weapon on the server, then when it spawns the weapon, it sets the OnRepNotify var, then the OnRepNotify function attaches the weapons. My problem is that I want to attach the weapon to the FPS hands for the owning client and to the TPS hands for all others.
Then in the OnRep, you could do a "IsLocallyControlled" check. If it's locally controlled, then that's your owning client.
Ok. I tried something along those lines and it didn't work but I will try a different variation and see. Thanks for giving me some direction
Any tips on how to handle the "no return values from RPCs"/"get callback when RPC is done"? E.g. client wants to call a server RPC, but wants a response (and can patiently wait for it asynchronously ๐.) I looked at the documentation for FPredictionKey from GAS and thought it was pretty smart, dunno if others have preferred approaches?
Why not use RepNotify?
That wouldn't work for cases where the RPC isn't modifying a variable. E.g. client sends RPC to server "spawn me a thing, send a reference to it when you're done"
You'd set the reference to that thing in an OnRep variable.
The only other way I can think of is sending a client RPC back with the reference, but if I'm remembering right, there's no means to guarantee that if you spawn something on the server and then say, do an RPC back to the client with the reference to that object that the reference would be valid on the client simply because the actor may not yet exist yet on the client.
So in replication graph, how would you guys make the spatial grid 2D node calculation the distance from the pawn's location instead of view location? Tried modify the source of spatial 2D grid node with no luck ๐ข
Hey, so I have an issue with OuterPrivate for UObjects and it's causing me a lot of issues with replication
https://forums.unrealengine.com/t/problem-with-replication-of-sub-objects-when-changing-inventories/267037
Searching over internet this thread describes exactly my issue, I do exactly the same on server but the object seems to stay stuck with the older outerprivate on client, and once I remove that outerprivate actor weird stuff starts happening
How can I make it so the client OuterPrivate also changes to the one I tell him to on server?
Can anyone with decent knowledge of the CMC tell me why in ReplicateMoveToServer we process Combined Moves locally?
I have the issue that if it starts combining, that the Client performs the non-combined move, then saves it as pending, then next frame combines it with the next move and performs it again, actively performing it twice.
If I print in PerformMovement, I get DeltaTimes printed twice (once with 0.016 (~61fps) and once with 0.032 (combined moved)). Server only receives the Combined move.
This doesn't seem to be correct. But it's the same since 4.24 and probably earlier.
Do I not understand something here? It actively causes bugs.
I would have assumed that the Local Player only performs non-combined moves, and the combining is only relevant for sending it to the server.
So Client would print 0.016 all the time and the Server prints 0.032.
Also lovely that I've been reading, using, extending this thing for years and only noticed this now.
It might also be that I'm not supposed to use PerformMovement to lower a value each move, but I doubt, cause it's all fine when not combining moves.
The only thing I could imagine is that the second PerformMovement, the one with the Combined Move, actually somehow goes back in time, and reverts back to where we were when that move was not the pending one?
Seems unnecessary?
Actually it does
I wonder why that is the go to approach, instead of just not handling this move locally
So I need to store my float value and revert it back to the old move here. Let's try that I guess
Can anyone help me out with how to do snapping in multiplayer, like if there is a socket and a cable , the cable should snap in if brought near to the socket.
I am new to multiplayer and trying to find how to achieve this.
Are socket and cable are some custom object in your game? In that case you just check and execute the logic on both client and server, then if they are connected you send a multicast to every other clients to connect the cable on their own machine.
Please don't give false advice in terms of usage of RPCs though
I know no one means harm here, but a Cable being connected or not is a STATE.
And a STATE should be an OnRep/RepNotify variable, not an RPC
People who join late or come from further away closer to the cable won't have gotten that RPC.
@peak mirage
I would say for starters it's enough to just register the overlap of the Cable end with the Socket, and on the Server (SwitchHasAuthority) set some Variable or Struct with information that is OnRep/RepNotify.
And then actually attaching the Cable based on that Information in the OnRep function.
@void wyvern If any of that is unclear, specifically the terms, please read the Network Compendium that is pinned to this channel.
@thin stratus yeah you're right, I thought that is a beginner question so I give him a fast answer that could work right away to avoid complex solution. Not an expert so just try to help as much as I can ๐
I fixed it. I just didn't (remember?) know that CombineMove reverts some values on the CMC back to values of the OldMove. Doing that with my problematic value that I was reducing in PerformMovement seems to have fixed the issue.
Still not sure WHY they run the Combined Move on the local Client too, but someone somewhere had their reasons I guess.
I really need to write down all the steps involved on how to add those "simple" things to the CMC, such as a Flue-based Boost...
No worries. I think that's fine for things like "Client Prediction" and stuff like that. E.g. them doing that whole stuff on the Server and replicating the Attachment with an OnRep to the Client, should be fine for starters. It's not wrong, it just adds delay they can learn how to fix later.
RPC vs OnRep is a fundamental thing though. Learning that wrong is not good :P
mhmm, that happens around line 8346 in CMC cpp, it reverts to the beginning of old move, then adds the deltas together and performs the move as normal to combine the move i think?
Yes
The Part I forgot/wasn't aware of was the "reverts to the beginning of old move"
My float was of course not being reverted
It wasn't even part of the SavedMove, as I didn't need it for replaying
ye ye, do you think you'll have to add something to revert the float back?
The server sends the correct version to the Client. Replaying would just reduce it, so I never tracked it
Yeah I had to add the Float to the SavedMove
In SetInitialPosition
And set the CMC back to the old move value
yeahhhh that makes sense
It's fixed now
nice exi!
Yeah it does, but why can't they just perform single moves locally
This seems so bug prone
locally as in on the autonomous client?
Yeah,
So
Frame 1: Perform Move 1 -> Save as Pending
Frame 2: Perform Move 2 -> Combine and Send
Instead they do
Frame 1: Perform Move 1 -> Save as Pending
Frame 2: Combine Move 1 and Move 2 -> Revert CMC back to Move 1 (where needed) -> Perform Combined Move -> Send Combined Move
Like.. why
hm... the only thing that i can think of is it might be something to do with the amount of correction happening with client adjustments after? but client adjustment is handled on tick BEFORE replicatemovetoserver even fires
๐ถ wants to be walked. brb
Another idea was to simply have the same mvoe locally that the server executes
so yeah, corrections could be a reason, but more for the future
I think that combined move also replaces the original Move 1 in the saved moves, or?
Would at least make sense
anyone know how to properly replicate anim notif? if I cancel a montage it happens on the owner side but not any other client side, montage just keeps playing
I would assume you need to cancel the Montage on everyone
AnimNotifies have nothing to do with replication
You just need to ensure the Montage start/stop is replicated by hand
this is kinda the hacky way Im trying to cancel it
I think ive tried a million different ways to cancel the montage on everyones end, its such a basic thing Im suprised I cant find anything on it
if it needs to be immediate, you could call a multicast on the server (issues with setting it reliable and gunking up the reliable buffer), multicasts called on the server get sent to all clients
however, it's preferable to have this be driven by an onrep variable so as to not create a new RPC or put stuff in the reliable buffer, this has the potential to be delayed but is healthier networking wise
so client -> server i request you do the thing, server multicasts to all clients after the check is validated
do you know if any tutorial that properly addresses this? Im just trying to cancel an attack animation after a certain time of the player walks forward rather than waiting for the entire animation to finish
hm, not off the bat, i'm not 100% sure but i would assume that the client calls an event that's set to replicated to the server, then that event leads to a call to an event that set to multicast, and in that multicast is the logic for stopping the animation?
i think, try that and see if it works, if not someone more experience can probably help better than i can LOL
okay will do thanks, atleast I know now its still a replication logic issue and not related to the notif
I dont understand I added 2 pawns and when I join session I dont see each other but when I use Actor class I do
what can be problem?
did anyone encounter a problem where after creating a dedicated server build it won't launch?
shouldn't this be in the package?
same thing happens when I try to join just on server ip with 88.212.47.71:7777
I have ticked all windows with replicate so I dont understand whatยดs going on
I should see pawn same as actor not?
but when I use thirdperson character with actor its functioning I am confused
Are there any IDs that is the same on server/client I can use to identify an actor purely based on a name?
The Actor's NetId I guess?
How do I get it?
hello exi do you remember our talk yesterday about non replicated pawn? what can be issue I tried almost evrything right after I change parent class of my blueprint and I join twice server I can see each other right after when I change parent class to Pawn
I dont
i am out of my mind
How do you guys solve saving references to actors in a replicated array?
Because replicating soft refs is not safe due to the path being different on server/client.
Would you just save the softptr and then resolve that and add it back to the actor array on load?
Why do you use a SoftPtr when replicating an array of actors though
Honestly not sure. I would suggest breaking your project down a bit. Using no Subsystem, using a fresh GameMode and fresh Pawn Class.
And then step by step reintroducing existing stuff and see if it fails/starts working
Iโm not. Thatโs literally my question
How do I save a replicated array of actors?
but does it make sense if this is parent its not replicated?
Ah you mean saving as in to the disk
Yeah that's fine, if the child is replicated
Yes, so should I save the whole actor as a soft ref and just resolve them all back into the replicated array
You can
And later load the data back into a freshly spawned one
It works if they're part of the level. The SoftPath resolves to the asset saved in the level.
Yes
Yeah but not dynamically spawned ones, right?
I guess that info was in the question somewhere?
Yes you can use them for that aswell
Because I saw some projects where pawns was normaly replicated i have no idea why its not working in my situation ๐ so should I make new project with new dedicated server and try pawn there?
Our save system just looks for actors in the level with the same name, and loads the save data for that actor. If there are none, spawn them in
And load the data
Just work in your current project and use some base classes first and see if oyu can get it to work without your custom code
Hm okay, pretty sure we mostly serialized our actors on the server and spawned them back in when needed
Don't think we used SoftObjPtrs for this in The Ascent
Why do you need to replicate the array though? Doesn't the setting of state and spawning handle sending state to the client?
Would make sense if it's some sort of shared savegame I guess
so use game base mode and fresh new pawn?
on current map
For example, yes.
Just don't mix up GameMode/GameModeBase and GameState/GameStateBase
You can only have GameMode with GameState and GameModeBase with GameStateBase.
tried this now
but I need use now parent class for my pawn as defaultpawn to spawn it
why it is not replicated?
parent class is pawn isnt it
Mostly just saying it can be
I don't know what stuff is replicated by default
I barely use Pawns
Making a respawn system, like you place out a sleeping bag and when you die you get a list of all the owning respawn points.
I need pawn because I want make a plane
i dont want to use actor like person
So need a reference to the componet that is the respawn point
Yeah I get that. Again, just try it with a minimal setup. See if you can see some very basic pawn
Or would I? ๐ Maybe some other smart solutions
In terms of saving, we probably just grabbed the Actor based on an Interface. Let it provide us with some Bundle Struct with all Info that is needed, and serialized that.
And when it needs to be spawned we read it back in.
In terms of providing a list of owned respawn points, I would probably just place the Actor into some RespawnPoint array on its BeginPlay or so
Depends on the exact setup of course
If it needs to persist who owns it I would probably work with the UniqueNetId of the Player
I'm lazy. Client should be able to easily just actor iterate that if it has a base actor class for that. UWorld is already handling putting it in an array for you at that point. You'd just need them to be relevant on clients at all times. Otherwise you're looking at requesting some pod data array from server and using that to request the right respawn point without the client needing the respawn point loaded via relevancy.
but how I can tell game mode to spawn my Pawn I created if I set gamemode base where default character is DefaultPawn
I need use default pawn here?
Just create your own GameMode that is empty despite the class selection
okay I created TestGameMode
and test pawn
where is only skeletal mesh and camera
If in doubt you should also try not using the Base versions of the GameMode and GameState at all
When you do Multiplayer it's best to just use the normal versions
The ones without the Base at the end
like this?
is this a GameMode?
yep
You need this to be a GameMode
You can't mix GameModeBase with GameState and other way round
Only GameMode + GameState and GameModeBase + GameStateBase
And for Multipalyer it's probably best to use GameMode + GameState
Idk what they all cut when they made that Base version a few years ago
It was originally only one class
Yes
and parent class of Postava(my pawn) is set to Pawn
Yop
That's still standalone with eos?
2x standalone and server is runninng from packaged exe
then I am logging there via open 127.0.0.1
local ip to test it
this is log of second to server maybe is there mistake but I cant see it
i have no explanation why this is happening
Iโm gonna use that setup! Thank you ๐
You are repackaging server and clients for this testing, right?
I'm still not sure why this would happen. A fresh project to test might be needed to rule out any problems with yours
With just a simple custom GameMode and Pawn. No EOS, just an basic Server + 2 Clients
Server of course to show changes and client, not as I am not running client package .exe but only 2x standalone version from editor to test
i will try make one maybe from vehicle example it would be fine , I will try after school
I'm not surei f connecting from Editor (even if standalone) to a Packaged Server is a good idea
I would try to package the client too before you waste time on this
okay will check but you know if it's working with third person character I don't see any logic why my own pawn is not working with it
it's program not woman
@peak sentinel Hey I saw an old plugin of yours, seemed like just making a replicated version of the floating movement component. Why'd you stop it?
Epic migrated to hyperwallet and I couldnt get payment because its restricted in Turkey
then they froze my account since I wasnt able to update payment info
though I was not going to support it anymore
people were always coming with weird expectations like moving 1k characters with zero overhead etc
Wack
yeah ๐
I just noticed it 'cause it looked exactly like something that I thought about doing. Pretty much a super simple replicated movement component more or less. Not every game needs all the fanciness of the CMC ๐
Yeah, only problem is it was breaking the ACharacter inheritance chain because I wasnt able to act like CMC doesnt exist in ACharacter
then wasted one week to completely get rid of CMC side effects and implemented my own solutions etc but then I needed root motion movement
and couldnt implement back at the day with my limited knowledge
then switched back to CMC 
Well - Character is like the only thing that inherits from Pawn by default, right?
should have used Flecs or ENTT
yep
SLOW oop
