#multiplayer
1 messages ยท Page 578 of 1
where should I put the has autority node?
and should I put authority or remote?
I tried both ways
they both still give the same errors
well first thing your doing wrong is..Anything that needs to be ran on server should be ran through a custom event and set to run on server.
well its just suppose to be a local radar not for everyone
should I still make a custom event and run it on server even if I just need the radar on one class of p layer?
and use get player controler not get controler
has authority is fine for now tho
focus on your cast that needs to be fixed and able to work. Tried using get player controller? instead of get controller?
i don't think is supposed to be a pawn
I tried it with get player controller I get the same errors as about with authority connected I get more errors like in my pictures, same ones, if I use remote I get less errors same ones as before
are you sure your casting to the right controller? i see a begin play. has the controller even spawned yet when this code is called?
if your using the right casting and it fails on server and client. This means your controller object has not been created yet and does not exist. That is why the cast fails
so my replicated player controller is not created ? is that where the problem is?
can not replicate if its not even created yet. Is that code for your radar in a widget or hud?
that code is on the character
ok then try a delay
before the cast
like 1 second
see if it is because the character just got created. maybe the controller has not spawned yet and possesed the character at that point
i mean thats how i think it would work character spawns then controller is spawned and it possess the character. So if you put a cast to the controller like that at begin play maybe thats the issue.
i tried with the delay, both with switch has authority and remote and with out the node, same errors as aboove
thats the thing. I cast to my controller from so many places all the time and it works. I have not see one error yet. This could lead us to the problem. should say access none
it says access none for the radar widget
im just confused as to connecting it one way, makes some errors go away, shoud I try a custome event?
no has authority will do same thing go one way if server go other way if client. All you need to do is make changes on server and the changes replicate to the client if you have them set to replicate
so yea everything should go through custom events ran on the server. Why? Because that is where all your objects exist. They do not exist on client. Client is just a window into what is going on on the server.
you want access to a controller? you need to access and make changes to it on the server
can do this with custom event then set to run on server ๐
for your issue here is how I would tackle it. on server have a function custom event named update radar.
Put this in your controller
set up a timer by event
set the timer to the amount of time you want inbetween radar updates
build the array of objects that will show up on the players radar
because the custom event was ran on server and it was in the player controller the array of objects that need to show on the clients map will be replicated to the client.
all the client code is to read what that array of objects is and it should know how to display them on the radar
Im going to try putting all the radar code in the player controller, and see if it fixes the issue
so think this way make change to server use those changes that are replicated to client to display what you want the client to see
im need a smoke break lets see if moving the code over will fix my issue
kk
@winged badger @ancient summit @near bison I'm at work now. I slept through most of those messages. I noticed zlo said something about gamemode and gamestate base. Is it the combination that matters? I want both bases or both non base?
it gives you control over match start
I forgot about the gamestate having to match.
I had elenby exact issue till I change them both to non base
its more or less standard practice to prevent match start until all players have loaded after seamless travel
also
GameState, as opposed to GameStateBase provides one very convenient network guarantee
GameState Actor will have replicated before any of Client Actors call BeginPlay
That's very nice to know
as its replication is what starts BeginPlay on Client's World
can't be any other way
Thank you dude. This actually became a bit of crucial info for myself
Think about it when you finally release your first game and all that working code you get to reuse.
Lol
i wrote the codebase modular, good practices, minimal coupling, draconic encapsulation
i would still need to clean up and refactor for about 4-6 months
that does not sound fun
before its really reusable out of the box
why use a system that can not be reused?
i have deadlines, i can't rewrite systems whenever i like
Can I ask your opinions on the differences between abstraction and encapsulation?
so some organic growth is inevitable
To me it's a big grey area in definition
i see I guess that is the benefit of having your own studio no deadline
abstraction exists to minimize coupling/dependencies
Removal of unnecessary details
well that would be good for cross platform
encapsulation is more of a forcing all the code through one "legitimate" path only, which reduces the potential for bugs, and makes maintenance easier
Mattxor you run your own show?
That's about the same def I've heard other places. Yours is more clear tho
well i have a business partner we are 50/50 but he does not work well with others
was proud when one of our programmers rejoined the project and everything exploded in his face whenever he tried to take a hacky shortcut
More concise of a definition
he is still working on the same game from 2 years ago
Lol
i have released 2 games
I'm trying to get the blending and animations down
yet he dont want me to lead says he dont like being told what to do
i swear he is a child
We didnt use any free assets and are 4 months in on this new rebuilt version with out animations still lol
good advice never get a business partner lol
The thing is I am the programmer so I would be the worst asset to lose haha
@winged badger - from a software engineering point of view have you used / considered using test frameworks (C++)? Just wondering I don't hear much about them in the Gaming world
Ya my guys and girls hate mr. I wanted to be the artist and idea guy and ended up being the programmer lol
Not very good at it but after a year and half of experience my stuff works now lol
well the whole Idea around object oriented programming is the best thing in the world. I am happy to be here for it.
@ruby rock never got around to it, altho 3 years into the project i think it would had saved me some headaches if i did
Thats the bad thing too. These guys like Zlo get stuck when they could be able to do so much more. But at the end of the day it comes down to $ ๐
Can knowing ue4 fairly well actually get you a job tho?
How can you achieve team based visibility in a multiplayer environment
A team is made up on players
There are numerous teams
Only certain teams can see certain teams
Check if team = team
Why would you want a job doing ue4. You want to get stuck doing what Zlo is doing and have no room to grow.
On item begin play if team is not equal set to non visible
JekasG use actor tags
Will it just not render ? What about collisions ?
Isnt actor tags expensive in a multiplayer game
depends on how many people
What do you mean by actor tags
That SetVisible is global right ?
I want certain people see me and certain to not see me
well the way my targeting system is set up is based on tags
it gets all actors with tag and attacks closest one. But it could be used for the teams to figure out who sees who
an array of 100 is nothing if it has to do it only one time on initial setup
What if it changes at runtime
you can delete and add tag to actors they could switch teams if you want
you could mostly be overriding IsNetRelevantFor
So SetVisible would be local for each player ?
to check the TeamID for the controller
or set it up via ReplicationGraph, team Buckets
if you're BP only, you just might be out of luck
Im C++
team interface on the PCs
Cast the RealViewer to the interface in IsNetRelevantFor
compare TeamIDs
and force it to return true if the TeamIDs match
Is it a hack
if not, then do whatever condition fits best
with normal relevancy, no
its the way to do it
Do i also use SetVisible ?
replication graph would probably be more sofisticated here
no, non-relavant actors don't actually exist on clients, unless they are static
they get destroyed when not relevant and spawned again when they become relevant again
you don't
the dynamically spawned actors that IsNetRelevantFor returns false
Yes, it changes at runtime
will get destroyed on the clients for which it is false
I see
so they will be invisible by the grace of not existing to start iwth
Is this a tick function ?
not quite
NetDriver evaluates Actors for replication, but has a cap on how much time it can spent doing that
if your network is completely unburdened, it will be the NetUpdateFrequency, how often they get evaluated
well that don't sound good if you need it to be instant
you can ForceNetUpdate
OOF
but best not to abuse that
oh nice
ForceNetUpdate is for GameplayCritical changes
and for actors that have super slow NetUpdate intervals
its pretty critical if another actor needs to be relevent
like, actor needs to update once in 20 seconds, so you might as well drop net update frequency to 0,1 or so to let your net driver breathe, but forcenetupdate when the change comes
say a cloaking skill?
So basically IsNetRelevantFor should handle everything for me as long as i return the right value
It should "hide/unhide" players that arent of the same team
but its not hide it don't exist?
@plucky sigil replication graph might be more suitable for a team RTS
as you can easily setup shared vision and such
IsNetRelevantFor would make that... problematic
How do i use Replication graph
IsNetRelevantFor is the only way I see a cloaking skill. If the actor is not relevant on the client they can not cheat and uncloak the actor because it is not being replicated to the client correct?
yes, the problem is if you have a shitty or intermittent connection
because you will need that Actor back really fast when it drops the cloak
Thank you for clarifying because I will need this some day
There must be a way to fake the client. Maybe spawn a pawn for the cloaked player that will take over until the actor is relevant again
@winged badger If you switch to using replication graphs will your existing networking stuff be broken ?
Is it worth using replicated graphs if your game isnt that big. I mean how big should it be?
It was made for Fortnite
apparently kicking the player takes some time to do
how can i make sure that everyone update gets called only after the player is kicked?
To make a coop game does it have to be on steam if I ma using unreal engine? or can I set it to be something like through some custom server? Like how is the server system work in unreal
@meager fable check if it is valid
Might be dumb but I would check is valid on the player controller kicked. On true just loop back until it is false. Once it is no longer valid could do update then
yeah i tried doing so but it threw an error that an infinite loop is detected
so i just put a 1 sec delay
and it works
yeah that's what I think too, I just dont see it yet
@light cloud can set it up to dial an ip address. Just if that address changes you would need a game update to change it. Need something consistent to avoid down time. I think I seen a tutorial on using amazon web services
Our game just has a dialer right now. We type in the ip address and port number. If no connection happens it times out and returns to menu. If connection happens it shows a load screen while they wait to load the session
I wouldnt release like that tho
I'd set it up to use steam online sub system at the very least so they could connect through friends list and all that good stuff
I think setting up a dedicated server requires some c++ tho
Thx @soft girder for the fast response, I will watch some tutorials about that, but if a server is on spesific IP and port doesn't it need to be on like some sort of a storage?
Not sure what you mean by storage
you know, some games has server storage which they can click "create server"
it saved in their storage no?
I am new to the multiplayer systems
It creates the session then if you set it up like that. If your talking about saving save data I think @vale ermine was talking about dynamodb last night
I would focus on learning p2p networking and the listen server way of doing things first.
Like one player is the host type of setup
If I had a variable in PlayerState (call it Health), and I wanted to use RepNotify to setup a reaction to that variable in the Character or PlayerController - how would you go about that? (Thinking is to update a progress bar widget)
Hey all, is there anyone who used OverrideWith event on PlayerState that can help me? I'm working on my reconnection case and having some issues, the variables I get from the returned PlayerState has default values instead the old ones
repnotify could call a function in the owners widget
do something
but i believe the progress bar is bindable to a value
You'd want to avoid binding for performance though yeah?
(My understanding is that it effectively ticks waiting for updates)
function in the owners widget
You meaning doing something like get owner pawn -> cast -> get hud -> get widget -> update?
I was thinking to maybe use an Event Dispatcher - but can't seem to make it work on clients..
i feel like that performance loss for a widget would be minimal
if your ticking the shit out of something somewhere else that you cant let go of by all means just update it onRep
small operations on tick are ok
i know tick is the devil
but the devil is in the details here so to speak
depends on what your doing
i do alot of shit on tick
the little screen at the bottom is like a digital scope
the name inside comes from the result of a sphere trace that is happening on tick while this scope is valid.
i didnt lose a single frame from doing it this way so far
maybe when we build the final version i will have a better way i hope
but as long as the operation is small tick wont hurt.
now if you got a crap ton of actors ticking (which tick by default) then that would be bad. its best to disable tick on each blueprint that you dont use it. this could save alot
ok, so can I phrase this a little differently.
If you had a gamestate variable, call it Score for instance
And you wanted to detect when a player got their Score past say 50. You'd want some custom event to fire
I think I just answered my own question ๐
i think you know what to do
hey guys, i can't seem to pass an array in a RPC function, the array size is allways null for the server
it is an array of pointers of a class I made that derives from UObjects
Are the UObjects replicated ?
Well, they aren't I guess since UObject doesn't provide that
wait ill make you some snippets ๐
this runs in the gamemode (so stricly server)
but has to pass this to the client (serverside)
UPlayerServerInfo needs to be replicated, that is, these objects need to also live on the client
The likely fix here is to make that class an USTRUCT instead
UObjects are heavy objects that aren't passed as copy ever - they are in fact, non copiable. The logical follow-up of that is that UObject RPCs only replicate the pointer, and clients/server need to have that UObject existing already. So you're really passing a pointer, not a copy.
This would work if these UObjects are replicated
But UObject doesn't do that, out of the box
yeah okay, makes sense
Actor/component do
but can I pass them as a object then, not pointers?
Structures are however passed by copy, and support replication with USTRUCT + UPROPERTY
So that's the simpler approach
But it's obviously fundamentally different
so I shouldn't copy those UObjects to the server
but the thing is, I need that playerserverinfo to communicate with a entrywidget for a listview widget, and the only input you can give is a UObject ๐ฆ
nono i dont replicate the widget, i just need to pass the info from the server to the clients, and the clients themselves add the list items
but the only thing the clients can call on a UListView is AddItem(UObject* object);
The short answer is that you should make it a structure, and have your widgets use that structure to then do AddItem() with a new client-side object
that's why i made a class deriving from UObject
but will I be able to pass an array of structs from the server to the clients?
Yes
thanks for your help btw, I realy appreciate it!!
okay, so just create the same class but as a struct instead
but does a STRUCT derive from UObject? because i need to pass it with the listview function
No, structure are basic types
Your UI code will need to create or manipulate an UObject based on the data in the structure
oh okay okay I get it
Basically you have two mechanisms for networking in UE4, and two target objects
- replication (server copies data to client(s) ) vs RPC (client/server copies data to client(s)/server)
- UObject (can't be copied, is garbage collected, has to implement replication for anything network related) vs basic types (can be copied, can be used for replication/RPC with no effort)
so I could just pass the structs, and then in the client, make it a UObject
to pass it to the listview widget ๐
and do I pass the array of structs by reference? no right?
Doesn't matter, but reference works fine
but not pointers right?
Yeah, pointers to basic types can't be replicated
okay perfect!! ๐
Basically UObject is pointer only, and the rest is anything but pointers
thank you, ill implement it now
(including shared ptrs etc as pointers here)
Does it make sense to set a repNotify on a playerState variable?
I'm trying to repNotify my playerName
it does, if your Players have to RPC their name to the server first
This is the code that runs when my player joins a session
unless you delay UI init by a lot, odds are not all PlayerNames will have replicated
What would I have to do next to ensure all clients see everyone's names correctly
I'm guessing in the OnRep_PlayerName I'd have to set the textRender for the player?
Could you briefly explain what delegating means in this context
and bind to another delegate that you add to PlayerState broadcast when the name is changed ?
PlayerState add a delegate (Event Dispatcher for BP)
and broadcasts/calls it from OnRep_PlayerName
notifying any UI and other object that might be interested in the PlayerName, but has accessed the PlayerState's PlayerName before it replicated, that the Name arrived
pardon me for drawing parallels here, but for my understanding:
it's like event listeners for the web?
and the event in this case is the repNotify of the playername variable?
event listener is for example a UMG widget thats supposed to display that Player
when its constructed its given a reference to specific PS
by whatever constructed it
then it tries to SetText for the PlayerName
however there is no guarantee that the PlayerName is good at this point (if your Players have to server RPC their names at BeginPlay)
so, just in case it isn't, the widget binds to a delegate in the PS to get notified when the name changes
instead of repeatedly checking
Ok yeah, I get the basic idea
@winged badger Im still having issue with the team based visibility
@winged badger so just to be clear
- I create an event dispatcher for my widget (in this case, my TextRender for character). This event probably takes an argument like playerName
- I have a repNotify for my playerNickname. in the
OnRep_PlayerNicknamecall, I call the event dispatcher for that widget, and I pass the playerNickname - SetText will be called in the event dispatcher
Something like this??
by bind, you mean in my widget's beginPlay I call the event dispatcher right?
Something like this?
where did you find a BeginPlay on a widget?
I mean BeginPlay on my character**
The TextRender is in my Character blueprint
you bind to it, not call it, like in the screen
you also immediately try to set the Name
just in case it arrived already
What's the event dispatcher supposed to do now? Because I'm not getting the PlayerName from the character BP, I'm getting it from the playerstate itself
So I'm guessing the eventDispatcher will be responsible for setting the text on the character's TextRender now.
@near bison you're mixing up your terms fairly bad
so i have no idea what you're on about half the time
i suggest a trip to documentation on delegates/event dispatchers
hi folks, what is this gameplaydebuggercategoryreplicator
and how i can remove that?
Isn't event dispatcher just a listener?
If On XYZ is considered an event dispatcher, then it is just an event listener.
hey guys, would you have any idea if a TArray of structs can replicate to the client side automatically??
this is the array, and im setting it server side, but the client local side doesnt get a updated array with the right values ๐ฆ
Is FPlayerINFO an USTRUCT with UPROPERTY on all relevant fields ?
Is the object owning m_PlayersServerInfo replicated ?
well that's the pawn, so yeah?
Then if this compiled correctly, and the pawn is created on server, it should work
but is doesnt haha
wait ill take another snippet
this function get called by the gamemode
so for all players it updates the array serverside, but not client-side ๐ฆ
even tho m_PlayersServerInfo is a Replicated array
How sure are you that it doesn't update client side ? How did you confirm that ?
because it crashes when i do this
it should contain an item (client side), but only does serverside
How did you make sure to call this code after the array had time to replicate ?
hmmmm interestingggg hahaha
can I make sure it finishes before calling updateplayerslist?
but it is only 1 player? so it should be pretty instant no?
Nah
im testing with one item in the array now
Here is the only assumption you are allowed to make about multiplayer timings : "Reliable" RPCs will fire in the order they were sent
It ain't much
Other things you should assume to have random timings
so like i should update the playerlist every 2 seconds or something xD
Replication in particular has bandwidth limits, priorities, etc - nothing about it should ever be assumed, other than at some point, the clients will catch up witn the data
Let's assume you are displaying a list of stuff on clients
Your list can update in the replication event for the array
(ReplicatedUsing)
Anyone know how to create teams in a multiplayer environment where players of the same team are visible only amongst themselves ?
does anyone dont know about gameplaydebuggercategoryreplicator ? 
does anyone dont know about gameplaydebuggercategoryreplicator ? :pepehands:
@bronze arch nope haha

Thanks a lot @bitter oriole, I'll try checking the list every 2 seconds for a update
i hope it's just because the array is not done replicating
Just use the event
and I just have to put replicateusing? that's it?
Wait a sec
kk :))
virtual void OnStuffReplicated();
UPROPERY(ReplicatedUsing = OnStuffReplicated)
T Stuff;```
sooo... onstuffreplicated will get called if the T Stuff is done replicating?
Every time it's updated on the client (not the server, in C++, IIRC), OnStuffReplicated will be called
so it gets called at the start of replication, not at the end?
so i'd still have to add some delay or somethin?
It will be called, on clients, every time a new update has been written from the server.
For the record this stuff is why multiplayer is not a great idea to start game development
Massie learning curve here
There is this annoying glitch I've noticed in 4.25.3. My PlayerStateClass keeps getting set to None, and it has wasted so much of my time ๐
Can't say I've ever had that happen. Have started quite a few different test projects on 4.25.3.
@bitter oriole It works! ๐ but not if i add multiple clients hahaha
i think the server is not getting the actor reference properly
can i just pass this in a RPC function?
Sorry I have no diea what you're saying here
What doesn't work, what are you doing
well in short, a pawn gets created, in his beginplay() (fully client-side), he creates his serverinfo, then passes a reference of himself + his serverinfo to the server
there, the gamemodeclass (server-side) needs to add him to a Tarray of players + add his serverinfo to another Tarray of serverinfos
Having the pawn beginplay RPC the server is problematic
In order for RPC to be possible, the actor needs to be owned by the local player
For a pawn that means possessed
Not sure that happens before BeginPlay
How do you guys deal with an array that gets disordered? Whats the method to keep the list ordered?
@twin juniper need more context
@twin juniper Array.Sort(someLambda)
Its an array of player ids that i require to keep ordered and it remains such even on seamless travel.
Not sure that happens before BeginPlay
@bitter oriole I should use postlogin right? xD
A sort may not be necessary depending on the context. If you have frequent insertions, you can just insert at the right place and it will be O(n) ordered all the time
@twin juniper does the order change on seamless travel? I'm not aware
@twin juniper you just need an ordered set no? TSet exist I think?
Yes it tries to remain ordered but idk ue4 does some weird shit where the list gets disordered and people id will be moved up ahead of others i think its some like latency thing idk.
One more important question: is this an array of structs/objects?
If it is, maybe you can tag along an additional property to the struct/object so then you can sort by that property
@royal rampart I'm just not sure you want that RPC from the client at all. The server should have all the required data already.
okay okay ill restructure the whole thing
MatchState in AGameMode doesn't have a delegate. I would need custom StartMatch/EndMatch/RestartGame functions with delegates for each. Doesn't it defeat the purpose of these built in states when I have to create my own Start/End/Restart functions anyway? I don't see the usefulness of these built in states
i don't see a need to broadcast that at all
especially start match
which every actor responds to already
For instance, I have a blueprint door that needs to open when the match begins
To allow players to exit their spawn area
hint: BeginPlay
Players spawn in a room, and once every player has readied up, StartMatch gets called
Then the door needs to open
and?
It won't happen on begin play
StartMatch calls DispatchBeginPlay
which calls BeginPlay on every Actor in the World
so, BeginPlay ๐
Interesting. I've always thought of begin play as a function that runs after the constructor
it does
Just not quickly after.
if the world already BeganPlay
if not, it "waits" for the world
(in other words, waits for StartMatch)
its all white on black in the source code ๐
I see. So the reason BeginPlay is running is because my match is already InProgress. I guess StartMatch gets called automatically somewhere. I'l need to prevent that in my subclass and call it manually
GameMode can prevent match from starting
That's not how you create materials
You should create a new translucent material in the content browser, expose a UMaterial UPROPERTY in your actor, set the material in Blueprint
And you can then create a new dynamic instance to drive parameters on
@plucky sigil what font is that, that looks awesome!
@royal rampart He's using Rider if I'm not mistaken
hmm can't find rider @lucid vault haha
It's an IDE
its an ide
Jetbrains Mono
i wish rider came fo free ๐ฆ is it free for students?
I'm using it for free
Nop
wait so rider is something like visual studio right? same same but different?
Early preview
Not as fast as rider
that's all ๐ฆ
VA is not free
yeah but as a student only 50 $
kinda worth it
but VA doesnt have cool fonts
haha
i just want that font man, looks so good
Yes! Rider for Unreal Engine will be an official part of our JetBrains Rider IDE, which we see as our main offering for game developers.
Delaying the start of the game won't work smoothly for me, because I want my players to spawn as a character in a room, and once they are all readied up, they keep their current pawns. If you delay the start of the game, the players will not receive pawns until the game has started. Even if you manually assign them pawns, they will get reset when the match starts.
I can either modify the functionality of spawning pawns to make it work, or I could just have a sub-state for InProgress called ProgressState. However, BeginPlay will not get called by the sub-state, so I will be required to create a delegate for actors that want to be notified, OnProgressStateChanged.
Honestly, the latter sounds like an easier solution. Has anyone implemented something similar?
Hey guys: You sure know what I need to do to succesfully package and build my project using the Advanced Sessions and Advanced Steam Sessions Plugins by Joshua Statzer, right?
When I build it the build ends succesfully but when I start the exe nothing happens. In the logs it says
LogInit: Display: Project file not found: ../../../SpaceAdventure/SpaceAdventure.uproject
and
LogPluginManager: Error: Unable to load plugin 'SteamShared'. Aborting.
I already tried the trick with generating an empty C++ class, which opens a dialodue asking if I want to make my uproject file writeable. But after I do that Unreal tells me some modules need to be rebuild and when I click okay that process fails saying it can not find the module with the name of my project. Someone suggested right clicking the blue uproject file and choosing "Genereate VS project file" but that doesnt work either as I dont have any C++ source files in my project (which makes sense as Im using blueprint)
Im sure Im not the first one to have issues with this, so if someone knows a good resource where the building process is explained Id be very thankful
@hazy spear The advanced steam sessions plugin would require the steam API be installed and configured correctly. You should look into setting up your project for steam support. Allar did a write up way back in 16' with the necessary changes https://allarsblog.com/2016/02/26/basicsteamintegration/
This is the first step in a series of guides that will show you how to enable the OnlineSubsystemSteam module for your project. It does not cover session creation, session management, app id association, or anything specific to OnlineSubsystemSteam. These steps are the first p...
Thanks @regal relic ! Ill look into it
anyone have extensive experience with custom character movement components in C++? I'm using custom compressed flags to trigger some movements over network (sprinting, sliding, wall running, etc.) and i keep getting this warning in the output log whenever i play on the client: LogProperty: Warning: Native NetSerialize StructProperty /Script/Engine.Character:ServerMoveDualNoBase:InAccel0 (ScriptStruct /Script/Engine.Vector_NetQuantize10) failed.
Anyone having any issues with Advanced Sessions plugin recently? Create Session (OSS) is working on Standalone, but in my packaged game, create session doesn't work
On further inspection, my cast to GameInstance is failing in the UMG widget, when I click on the button to create a session
Why is my cast failing only on a packaged game?
Is there something specific you have to do in steamworks to get your app ID to work? I can get 480 or ids of games I own to work but not my own. It also says my account should automatically get license for it but when checking in steam dev console it says I dont have it
Why doesn't RestartGame() work for clients in PIE?
Hey solias what net driver are you using?
Hi, I'm trying to pass references of everyone's PlayerController from the Server's GameInstance down to a client's UI widget. I'm passing it through GameState and PlayerController and finally the widget, but while the array makes it there, the data isn't right. Is there a better method for this?
Player controllers cannot be replicated to clients
What you actually want is for the data you need to be in PlayerState
Which is replicated to clients
And then the client widget can just read that directly
No work required
What is the 'User Index' for and should I be concerned with it making a Multiplayer PC game?
@normal jacinth Iterate on PlayerState actors, or get a PlayerState from a pawn
oh awesome, i'll give a go thanks
I'm struggling a bit. I need the position of the other players, in a widget. I've only got it working by setting a reference to the PlayerCharacters On Tick, which is awful. Is there a better way?
How do you guys integrate libuv to this engine? I'm starting to lose my hair when it comes to third party...
I'm having some trouble. I'm trying to just display a player's name over their head and it's turning out to be more complex than I anticipated. I can't find the right time to get the information. I'm trying to access the PlayerState to get the player's name. Is a PlayerState created by the server then replicated? Or does a client create their own copies of all of the PlayerStates then wait for those properties to be replicated?
Does gameinstance spawn for every player in a lobby? Or is it 1 per game?
1 GameInstance exists for every player on their own Machine.
Imagine the GameInstance as the actual process for the game running on your machine.
How do i disable the spawn of a playercontroller/actor if you're the server
You cannot stop PlayerControllers from being created.
why cant clients widgets send Replicated fuctions to other actors wich mean i cant make my clients be able to interact with anything through UI
replicating UI would be... more then a little complicated
and impossible in blueprint
in comparison, calling an RPC event on an owned Actor is super simple
my widget canm call an rpc of its owner ctor but anyother actor and it dose nothing but idk how then i would be able to make my players widget get a npc/other actor the players interacting with
Would the only cost to replicating 2 uint16s over a single combined uint32 just be the fact the Server has to check 2 individual values for a change in value?
There would be no bandwidth benefit to combining into a single uint32?
@fossil spoke GAS uses bulk RPC .. so basically you can combine two RPC into one.
That doesnt answer my question.
@slim matrix so you want 2 players to interact within the same container ui. like trading?
if you want a good multi player ui system the Action Rpg Inventory system on the market is set up for multi player. You would be able to see how the two players can open the same container and move items around and see the changes on both clients
@fossil spoke only reason i'd ever combine them is if they were... atomic
should i also use BP inerfaces
yea that is how they do it
and i wanted to handle replication callback for both of them, having access to both of them inside one function
only if those were 2 related non-exclusive states
otherwise even if you had minimal gains its not worth obfuscating the code for (and you would on average spend more bandwidth, since you would have to replicate the full 4 bytes whenever any one of them changes)
Yeah for sure.
@twin juniper thanks but I fixed it.
The cast to game instance was indeed failing in the packaged game.
The path to game instance in DefaultEngine.ini was wrong (not sure why this reflected only in a packaged game though)
Does anyone have a config setup for how they are using steamsockets netdriverdefinitions in their engine.ini?
Hey all, is there anyone who used OverrideWith event on PlayerState that can help me? I'm working on my reconnection case and having some issues, the variables I get from the returned PlayerState has default values instead the old ones
Okay I guess I found my problem about OverrideWith, I wasn't firing the OnLogout event to register my old playerstate in inactive playerstate array. So it was giving me a brand new playerstate. Now my question is how can I simulate logout case on PIE
hey guys, would you have any idea why my game would crash with multiple clients??
the log says READ ACCESS VIOLATION, but I have no idea where it's coming from ๐ฆ
Debug it
basically, I'm trying to send playerinfo (name + isready(bool)) to the gamemode when the game starts
im doing that from beginplay
hey stranger ๐
you already told me that it shouldnt come from beginplay haha
If you have a crash, every time, your answer is to run from VS and get told by VS where the crash is
but if I do it in postlogin (from the gamemode) same problem, I think the character is not fully initialized at postlogin
If you have a crash, every time, your answer is to run from VS and get told by VS where the crash is
@bitter oriole I don't even know yet how to debug unreal in VS haha
ill look it up
Press F5 in VS, basically
Don't change anything, just press F5, literally
okay thanks ๐
hahaha that launched my editor a second time
i need to set the configuration to debuggame i think
ooooh okay
omg I love you
I had no idea it would give me the exact location where it goes wrong
it just did โค๏ธ
(nohomo)
See, I wasn't exagerating here
Important stuff includes the call stack panel, which is useful for context
And there are locals & auto panels you can get from debug - windows that give you some variables
You can use DebugGameEditor now when variables are marked as optimized out
But don't forget to go back to Development after you're done
okay.. it calls a function from a class that doesnt exist yet basically haha
What all can go wrong when using globaltimedilation per client to slow down time every time the client dies?
Won't really work. Anything using replicated movement will still snap to wherever it's been moved to.
Any other issues than snapping? ๐ค
well, character movement will stop working
There's probably no limit to how many things that can go wrong when you start running the server and clients in different timesteps tbh
Just have to try it and see
Just think, conceptually, about how you would handle slowed client inputs on the non-slowed server.
What works well (with some effort) is localized slowdowns where all players are slowed within a zone
Or slowing down one character, for all players
Or the whole scene, for all players
Hey guys is there a way to do replication in actor component ? .. the actor component will be attached to the character
Hello ! Someone who already setup a dedicated server with Steam could help me ? My dedicated and client are connected to Steam successfully but I can't see the session and the server is tagged as "LAN" on Steam server list even if I unchecked "LAN" on the session.
hey guys ๐ small question, Is it possible to send your playername (before you join the server) to the the server when you join it?
is there like a class that stays alive before and after connecting to a dedicated server?
there is not no, but when you join, your player name usually comes with your join string/options
Also depending on the platform, the server can get the name from the unique online ID
Quick Easy/Dumb question. in an MP game where you may possess a car and other things, what is possessed? The controller? If so, where would you define controls and UI elements that would be persistent regardless of which controller you possess?
Depends
Usually the vehicle itself is a pawn, and you would possess that
The controller is never "possessed", the pawn is
yeah
Which is why any pawn-specific input such as "walk forward" etc. should go in the pawn not the controller
thank you. that makes things much clearer lol. And when you attach a pawn to a new pawn (like a driver to a pawn) it usually is the car that plays the "driver" driving animations correct? the walking player pawn is destroyed and recreated on enter and exit?
I keep the same pawn usually
And just apply a different animation blueprint to it depending on what "seat" it's in
you attach to parent?
yeah, possess the vehicle, then attach the character to said vehicle
is that the proper MP way? to attach to actor component?
You don't have to do it that way, in another game I work on where vehicles have multiple seats the player stays possessing the pawn, and the "attachment" is replicated through the seat itself
OK so either way Id need "seat" components in the car to either attach or represent the player in that seat though right?
Well we use seat "actors", since the seat is usually something the player has to own in order to call RPC's etc (since they need to do things while in those seats, not just sit there)
ok that makes sense. The whole RPC thing just finally clicked for me a while ago haha
for some reason client side cant find the other actor to destroy it
but it works fine from the server side
any helpM/
?
Is it possible to have OnRep called for server ?
I want to do some sever side only stuff
what do you need OnRep for then?
Or should Client RPC called on OnRep ?
server can do its stuff when setting the variable
doesn't need a replication callback
(with blueprints you'll get one weather you want it or not though - on Server as well)
c++ is more civilized, won't call OnReps for server
server can do its stuff when setting the variable
@winged badger How do i make this stuff i want to do only happen on server side
make a Set function for the variable
do what you need to inside of it, and set the variable
never set the variable directly, always use the function
๐ค
I want to be able to have two versions of things happen when that variable is set
Inside the Set function i do the server side stuff
And OnRep i do the client side stuff ?
then check IsServer, use Authority Switch inside of it, w/e
just don't call the Set function back from Blueprint OnRep
as the BP OnRep is a hack, not a replication callback
so if you try to set a variable you're OnRepping for from OnRep, you'll end up with infinite loop
Do i use GIsServer ?
Hey all, is there anyone who used OverrideWith event on PlayerState that can help me? I'm working on my reconnection case and having some issues, the variables I get from the returned PlayerState has default values instead the old ones
did you check if the data is valid in InactivePlayerArray?
you could just breakpoint the GameMode::Tick in the debugger and read the data out from Locals (while the player is disconnected)
or breakpoint AGameMode::AddInactivePlayer
and FindInactivePlayer
How do you mean by checking if it's valid? This is what I do in my playerState after changing the k/d/a variables a bit (and I see them on UI). I change map, travel to server again and the values that I try to get are all 0
i mean build DebugGameEditor binaries, start the Editor from your IDE, and put breakpoints in code to see whats going on
@winged badger I dont understand
I dont know where to put the server side logic
Player A kills Player B
Server calls PlayerB->Dead = true; andPlayerB->SetVisbility(false);
OnRep_Dead() SetVisibility(true); and RenderAsAGhost();
How can i do the OnRep_Dead() for when PlayerB is Server while also not replicating this to other clients ?
Hello. Is it possible to switch between characters using Posses and running it localy on the client with bCanPossessWithoutAuthority. What are the consequenses for this?
@winged badger Can you help me ?
Okay I see, I'll try it
if you're not comfortable with c++ i would not advise it though
i didn't know this was exposed to blueprint to start with, so i just assumed you were using c++ ๐
As far as I can see they both (c++ and bp) called from same function named DispatchOverrideWith
yeah, but the interesting part is where the DispatchOverrideWith is called from
From GameMode, on PostLogin fn
AGameMode::FindInactivePlayer mainly
Yeah, PostLogin calls find inactive player and if it's found it calls the overrideWith with old state
in my experience, engine can have a few landmines, more so in GameMode then other places
so its worth checking the values as it finds the inactive playerstate
the Event in BP is BlueprintImplementableEvent, so Parent call definitely doesn't do anything though ๐
@arctic lionas For server only sided stuff you can just use the switch on autority node
It will let the signal go through on the top output if the object using the node is owned by the server (aka it has authority)
i suspect this scenario is that owning player sees its pawn as ghost, while others don't see the pawn at all
for that you need IsLocallyControlled() check
if true, render as Ghost, if not set invisible
@plucky sigil
Okay one thing that I realized is, it of course doesn't have the blueprint variables in it since it's stored as the base C++ class in the inactive player list
I can see my Score (From APlayerState) is having the old value but still printing 0 at the ss I sent, so I'm now trying to track that
it does have the blueprint class type at least?
I don't know if I get what you mean correctly but no I don't have any reference of my BP class in my C++ base class (I don't even know if it's possible?)
i mean the debugger should still be aware of what type it is, regardless of what supertype its stored as
nvm, it will be of the right class, they are not doing anything crazy here
Okay am I doing something wrong or using this event out of it's usage? This is AGameMode::FindInactivePlayer(). I am watching the Score variable coming from APlayerState which I set to 1 before changing level and coming back. But the PlayerState given to OverrideWith event is the new PlayerState (named as OldPlayerState) so having the 0, default value
that is weird
so you have good values in your Active PS
before OverrideWith is called
God damn it, it's the CopyProperties event that gives me the old value
as they are swapped inside FindInactivePlayer
then they send the OldPlayerState (the one that was just spawned by the new joining PC)
as an argument to OverrideWith
Still blueprint variables are not coming but the score (C++ variable) is finally printing the value I set before reconnection
can you just Print those values on BeginPlay, ignoring both CopyProperties and OverrideWith?
Okay
i suspect epic did something very weird here
and very unnecessary
if that fails (as BeginPlay will probably not get called on the reactivated PlayerState)
inside OverrideWith, Print the value from this instead of the PS you get as a parameter
Okay, on BeginPlay it also gives the default values
Engine is 4.21 BTW, if it changes anything
i doubt they touched this code since 4.1
I thought CopyProperties was to get variables when changing level while still being connected to the server. And OverrideWith to get old PlayerState in case of disconnection and reconnection afterwards. But apparently CopyProperties is the thing to use in case of reconnection, now I'm not sure what OverrideWith does
i think its there to confuse you
Hahaha
// found it!
APlayerState* OldPlayerState = PC->PlayerState;
PC->PlayerState = CurrentPlayerState;
PC->PlayerState->SetOwner(PC);
PC->PlayerState->SetReplicates(true);
PC->PlayerState->SetLifeSpan(0.0f);
OverridePlayerState(PC, OldPlayerState);
so player rejoins
the PC is instantiated, it instantiates PS in its PostInitializeComponents
before this is called
then they cache the newly instantiated PS into OldPlayerState local variable
assign the PS that was in InactivePlayers to the PC (so basically at this point PC has its own instance of the PlayerState)
and do basic initialization on it
so thats it, new playerstate you don't need was swapped for the good old one
then they call OverrideWith on the PlayerState pulled from inactive list and send the vanilla one at all defaults they just instantiated as a parameter
so if you were to just Print those variables from OverrideWith but on self instance, not the one provided as parameter
it should work
Exactly
Just tried it and it works the way you said it. Apparently BeginPlay is called before this part so that's why it still prints 0. So these are just events to let us know that the old values are set
But I just don't get the difference
It's possible to get class defaults without having a newly created object. Why would I need to get my newly created PS before overriding?
Well thanks anyway for the debugging idea, I wouldn't be able to understand I need C++ variables for this without that and still be frastuated by not getting my old values on both OverrideWith and CopyProperties events
the c++ OverrideWith does some useful stuff
as the new PS spawned with the controller does have some automatic initialization
as the old, reactivated PS has no reason to call BeginPlay at all
i don't see how it would make its way back to GameState's PlayerArray
Steam is not working when I run the game standalone, it only works on launching the game. Can I fix this?
no
heyyy, mini question, is there a variable i can store in a struct that is unique for each client, even if they disconnect en reconnect to the dedicated server?
where should I look to track down why my OnRep_Variable functions are not firing some of the time on clients?
This has about a 50/50 chance of not calling OnRep_Team1Score
If the score increases too quickly, it's normal for only the last update to fire
Is it "safe" to increase the net update frequency of the playerstate which is by default extremely low (at 1 by default), I'd increase it to 10. Is that reasonable?
Question is why is it's net update frequency so extremely low in the first place? Which is why I'm a bit hesitant
Thing is that we've got a voice chat system which has a boolean variable which toggles true or false when a player uses voice chat, but due to the low update frequency it can sometimes take up to a few seconds before the boolean updates
@bitter oriole it's pretty slow (30+ seconds), it just sometimes doesn't fire at all ๐
but I'll keep digging
@void nest Call ForceNetUpdate when you change the bool instead
If you have a VOIP system though, then surely the client knows who is/isn't speaking from that and doesn't need a replicated var
ah yes of course doh why didn't I think of that
I'm looking around for how to use the console in a dedicated server instance, and surprised I'm not finding any answers. It seems most of the questions online are about how to do that programmatically from a game instance. I just want a TTY. For example, using "Device Output Log", I can engage with the console of a game instance running on another device. Is there no equivalent for dedicated servers? My intent is to check and set cvars.
What class is that in Chaotic? If itโs your player character I donโt think it can send messages to other clients directly, you have to go through another class first
Or, because the character is replicated already, make sure the light is set to replicate
@normal jacinth first yeah its my character and second how to i set the light to replicate
Select it on the viewport and choose โreplicatesโ in its Details panel
Yep
When im replicating particle spawn why does this not work? I'm doing Input(from the player controller) > Server RPC. It only works when I put the multicast and particle spawn on my actual player NOT the controller.
@sudden spire is it necessary to put flash light on another class?
hello, is there a multiplayer network course somewhere?
I would have thought that tick box would be enough
k and then?
check replicates
checked already
are you calling it from server
Server call > multicast
oh yea
ur missing server call
Brocori I donโt think player controller can multicast, you need to go through gamestate or something similar
ohh it works on player character
that makes sense
@foggy wave do it like this
however
make sure the last bit
Character replicates, controller doesnโt
Go from Player input > Run on Server > Multicast
Currently you are Player input > Multicast
look at my picture
the middle event
np
is your multicast on a controller?
it looked like it
actually i think you can put input on characters like that too right?
Is GameState (server) - Get all actors of class (Player character) -> correct way of playing functions on everyoneโs character?
Anyone know how to simulate lag? Net PktLag doesn't seem to work
it does work
Maybe I'm using it wrong. Is it supposed to be called from the console?
Maybe I'm using it wrong. Is it supposed to be called from the console?
@uneven cliff shouldnt you supposed to put it to DefaultEngine.ini ?
`[PacketSimulationSettings]
PktLag=500
[/Script/Engine.Player]
ConfiguredInternetSpeed=500000
ConfiguredLanSpeed=500000
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=5000
MaxInternetClientRate=50000
NetServerMaxTickRate=120
MaxNetTickRate=120`
add this to .ini file
Alright, I'll try that. Thanks
Oh that's nice and all over the place. Thank you @peak sentinel
Is there a way, when using the editor, to increase the time until the server disconnects you and crashes when debugging? I'm tired of having to race through the break points to avoid having to start all over again because the IPDriver_0 timed out
I'm experiencing an extremely odd issue and would love to know if anyone else has experienced this, and if they were able to resolve it
I'm building a multiplayer game:
- When a single listen server is present, it can look around but not move
- When a listen server and client are present, but the client is a spectator, then the listen server still can't move. Even stranger, the client can see the listen server turn and even jump but the listen server doesn't even show this interaction
- When both the listen server and the client are spawned, both work as expected
Nick, somethings funky in the replication
Does the listen server see the client moving around and doing stuff when the client isn't a spectator?
in my constructor I have
HoleCardsCam = CreateDefaultSubobject<UHoleCardsCam>("HoleCardsCam");
bReplicates = true;
and I have this function
that is blueprintcallable
and it works when I am the server but not the client, any ideas?
no movment at all if I am the client
client is APawn
forgot the
UFUNCTION(Server, Reliable, WithValidation)
void Server_SendMove(FTransform);
Would making a dedicated server with playfab work the same way for oculus quest as well?
you could just make a c++ client/server function that calls a regular blueprint implementable event, depending on the context
Has anyone done anything similar to for honor's melee combat?
@soft girder i worked on for honor for a little while and all of the combat is animation driven, this is able to function well as the entire game runs under simulation.
realistically 'for honor' combat is several simple systems working symbiotically, first of all i would split the combat up
ill be back in a bit and ill break it down further ๐
Im have a Day/Night Cycle using my GameState to Increment DateTime and then casting from my Level BP to the GameState to update SunPosition. Im using FInterp to smooth out after timescales but its still jumpy.
Is there a better way besides casting every tick? Like an interface or putting the code in an world actor?
like having the Sun Actor update itself as it has access to time and doesn't need external object to update it you mean?
also, as long as your server/client times are roughly in sync (see ServerWorldTimeSeconds) in GameState
client doesn't need to be updated over network anymore, as the time passes at the same rate on client and server (unless you have time dilation and/or pause controls)
so client can move its own sun on its own and then it won't jitter
@winged badger yeah I have Ultra Dynamic Sky which uses a float(0-2400) that I lerp from the DateTime being elapsed. The reason Id like to control it from the GameState is so that the Admin Player can adjust DateTime/DayCycle on runtime. Im not currently using any RPCs as it replicates already right? I do note I have to replicate the variables in the GameState, but I dont need to call RPCs
It starts getting jittery when I multiply the time elapsing 60x and beyond. Im incrementing milliseconds every 10 milliseconds using an Event on the GameState
OK I got it working by adjusting the interp time to .01
OK dumb question though: Lets say I want an intermediate Lobby level, where players can spawn in and screw around, and an admin player sets the parameters of the new matches GameState before loading the actual gameplay map. How would I transport all the players to the new level with the specified parameters? How would I carry over the variables for the new GameState in the new level?
Hey all, my FSocket disconnects without any obvious reason from time to time. When I get error code with ISocketSubSystem.GetLastErrorCode() it gives me 26 (SE_ECONNRESET). Is there anybody knows what does it mean?
I have a situation where the client doesn't always (only sometimes) receive certain replicated variables (at least no OnRep is run) of other clients' pawns when they join an ongoing game. No OnRep is run when the client joins the game, and it only runs the next time the variables change on the server. I have no idea why. Ideas?
variables are references to replicated Actors and you're using Blueprint, would be my guess
They are structs in C++, contain one reference to a replicated actor and an enum value
the actor reference can't be resolved unless the Actor itself has already replicated
It has definitely replicated, it's visible on the client
you can't really eyeball that
which comes first, the variable replication or the replicated Actor
normally, c++ should call OnRep when the Actor's NetGUID is resolved
but i am unsure if having a nested reference would prevent that from happening
its not a structure i would ever use
Hmm, I see. And the enum value seems to be default at the one that they're supposed to receive. So yeah you're right, that makes two default values in the struct, thus no change
It's a variable describing an "event" like (spawned with this item, picked up this item, threw this item etc), so it's the item in question + the enum to describe what to do on client in response to this item reference changing
use a fastarray
I'm gonna have to change it a bit so that the item reference is always replicated at the time this is updated.
Hmm what's fastarray?
as item is a replicated actor im guessing
it can replicate its own state
so not quite sure why the enum on the side
FFastArraySerializer
its much more capable
does Add/Remove/Change callback for each of its items individually
and if a replicated UObject* can't be resoplved when PostReplicatedAdd is called, it will call PostReplicatedChange after it is resolved
Ah hm that sounds interesting. Does that mean if I have a fastarray with one such event inside, and the actor in question isn't replicated when the actor reference is replicated, then it's going to replicate the reference after the actor is replicated, on its own?
it won't replicate it, but it will trigger a callback
replicated Actor != replicated reference to an Actor
anyhow, the docs for it are in NetSerialization.h header
Thanks, will check that out, and come back if I don't understand ๐
@lapis breach thanks for responding. we are thinking of something similar
not really tho
hard to explain
Anyone know why this configuration of blueprints seems to consistently cause crashes? It only happens when I have a custom event run on the server into a custom event that multicasts (but regardless of what configuration I have I can't get the message to replicate):
how do i replicate those sounds so only the client can hear those , or maybe those who are around
because now where ever the player is can hear the other ones step sounds
SetVisibility turn on (previously turned off) doesn't turn on the visibility of my Character for the other clients immediately, only after he is moving. This is my setup:
It should only hide the character for all the clients except the client who hid himself.
I tested it with only the owning client and it works there, without moving. But it seems that for SimulatedProxies the SetVisibility set to on doesn't work immediately :/
we discussed this a few days ago
@arctic willow 10/13 is when we talked about IsNetRelevantFor and ForceNetUpdate but there are draw backs
okay, will have a look at that. Thx
The other suggestion given was replication graph.
Hi, is there a way to switch between GameNetDrivers on the fly during runtime? we would like to set up our game to support dedicated servers and Steam p2p play at the same time
Trying to run the project as network now, and I noticed my custom HUD event gets called when running as listen sever, but not as client.
Is the difference in these two modes the authority level at which your logic runs at?
@soft girder really you want to split it into two sections attacks and defence
defend is up left and right
attack is the same
the most fundamental part of that system is how the animations work
inside each animation there is a window which allows that particular attack animation to be parried or blocked
the defender needs to hit their response within that time frame
its funny i was thinking about how i would do it in ue4 the other day
i would create a notify state which set vars to allow a guard break within the period that you want to be able to parry and block
let me know how it goes or if you have any issues ๐ ill be interested to see how it turns out
@foggy wave don't replicate sounds directly, replicate the events or state that drive the sounds. For example, you don't do anything replication wise that involves the sound of a gunshot, but what you replicate is the fact that the gunshot happened, and locally on each machine the sound is played.
Hi all, got a question, I have steam works implemented into my project, but when running the game on two separate pcs to connect via steam matchmaking, they wont connect, here is my bp, steam overlay works in build, so i am very confused as to why it wont connect.
@lilac raven I don't understand your For Loop on join session; you're accessing an array after the loop has completed, which I don't believe works
@normal jacinth could that explain why when connecting through steam, it finds the session but fails to join?
What is weird is in PIE it works fine, connects to the server no problem!
what build did you create, development or shipping?
development
did you configure the steam app ID in configs?
yeah, I set everything up the way it is in the Documentation, if the appID didnt work surely the steam overlay would fail and it wouldnt show me playing spacewars right?
yeah that sounds right
hmm, it's strange, i can test a shipping build see if that works, I changed the for loop for a get copy of value 0
actually the shipping build doesn't work unless you have a registered steam id (something other than 480)
sorry I can't be of more help
ah ok, thats ok, thanks anyway! ๐
Hey all,
I'm making an infinite procedural game where the terrain is made using instances of a hexagon mesh. I'm wondering how I would go about setting this up for multiplayer. I currently have it set up so the seed of the noise generator is sent from the server to all the clients so everyone has terrain that looks the same. However, I'm running into some problems that seem to be related to Unreal not treating these instances the same across the network and it's causing various problems with player movement and collisions. Does anyone have a solution for this?
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: HierarchicalInstancedStaticMeshComponent /Game/Maps/UEDPIE_1_MainWorld.MainWorld:PersistentLevel.HexMapGenerator_1.HierarchicalInstancedStaticMeshComponent_17 NOT Supported.
This is with component replication disabled for the instanced static mesh components that are generated at runtime and actor replication enabled for my terrain generation actor.
why are you replicating them
@queen spade
you cant replicate a Instanced Static mesh
and for that to come up you would have turned on replicates on that instanced mesh
Guys, how would i make player make stay longer inside , if loses connection and rejoin the same game without going to the lobby, and sometimes what happens is if someone is disconnected then, there Pawn remains inside
if i put an instanced static mesh to my level, it wont be visible for clients??
@meager spade I'll have to look into it, I shouldn't be replicating the actual components, but the actor that creates them is being replicated. I'm just calling staticMeshComponent->SetIsReplicated(false); for each static mesh component I create. If I disable replication for the c++ actor that creates the components it doesn't show anything on the clients.
i don't even replicate an actor for procedural generation
i send the seed and just have the client simulate
all done via the gamemode
interesting, seems I'll have to rework some of this. Thanks for the help.
Hey guys! From your experience, how would you implements a Multiplayer Voice Chat, for about 10-15 people in any single game?
Also, must record each of the players session/channel separately. No sound FX or design needed, just simple chat and synchronized recording.
Preferably using BP
thank you!
@full ember Fortnite and Pubg usese Vivox. Please look at it.
๐
Epic EOS is due for Voice Chat support, you can also have a loot at that too.
Even though i just need a POC at this moment, I don't want to do all the heavy lifting by myself so I'll look into it.
hey
can anyone help me
I put this code and it is working for only server player
I need it to work for client also
@rich ridge seems like Voice Chat in EOS will be "coming later". so VIVOX i guess
Has anyone ever worked with long polling in UE4? I'm normally using Blueprints, but I have a community section in my app and I need to implement long polling to allow users posts / comments to be regularly pulled from my node API endpoint.
Is this possible?
Right now I'm using VaRest for doing individual JSON queries to my API endpoint.
Alternatively, I might have to use web sockets, which I am willing to do if required,since there are clearly plugins built to support it.
@twin juniper why do you have the switch has authority?
Possession should prob be done in gamemode. btw gamemode and gamestate need to match. either both bases or both non bases.
there might be a way to do via rpc calls from the level blueprint
idk ive never tried it from anything else
QQ; How would you ideally implement a "Press E to open" kind of door.. I mean, how does a non-owning client (of the door) transfer the "Open this door" to the server? Is the functionality for doors placed inside the player controller or pawn, which can execute server stuff (as owning client)?
@soft girder can u explain more
Actually my friend told me to use switch has instance
make sure that your gamemode blueprint and gameinstance blueprint both inherit from bases or non base. non base gives control over is match started and start match
what happens if you dont use the switch has authority?
oh never mind
player pawn 0
player pawn zero is always the local player of a machine
except if the server is dedicated ofc
you could prob just make an array of all playerpawns and loop through it
ive never used switch has instance so idk. he might have a good solution too
but the reason it only works for server is because its only getting player pawn 0 which is the servers local controller
you will need an array of all player controllers. loop through the array and give possesion to each controller
hang on i see what your doing.
let me get a test project and ill wire up a picture to give you
@twin juniper
what does this do
give the overlapping player a vehicle
you dont need an array
tell me the gameplay. im confused. is there already a character actor? and when it overlaps you wanna give that character the vehicle character?
what you have done will work but the target of the cast is always going to be pawn at index 0. you need the actual one that overlapped i believe.
im unsure what your doing. i need more info but so far im under the impression that the vehicle actor ovelaps something and you wanna destroy it and give the player a new one
if the vehicle is overlapping that newblueprint 1 thats the one you need to cast from
switch has authority is correct because only the server can give possesion. but who is being destroyed and possesing is the problem here
The aim is that vehicle when hit the trigger it get spawn to a position and also give its control but it is only happening for server
The bp I have implemented is working only on server
And I wish to use for client also
because the cast is always pointing to player pawn 0
you need the one that overlapped. thats what the blue dot on the overlap node is
Yes
Possess run only on server
And it is accessing only server controller
If I change the index then it is making problem
Yes
did you try this?
you also might need to change the cast to the overlapped actor instead of other actor
im doing it with a character instead of a vehicle and it works
what blueprint is that code in? the level blueprint?
Yes
hang on im gonna try and move mine over to the level blueprint and see if it changes
Okay
There are a few weird things in that Image
could he not put that code in the actual actor that has the overlap volume
- Calling Destroy Actor but then afterwards accessing it is not a good idea. Actor would be marked as PendingKill which could fail specific checks. Always destroy when you don't need the Actor anymore.
- The ID on the "GetPlayerController" is for Local Couch Coop. Not sure if it gives you anything in regards to actual Multiaplyer.
- The ID that you grab from the PlayerState, if that's your own, then it's fine. If that's the one from the native class, then that has nothing todo with the ID that the GetPlayerController wants.
- Why don't you just save the referecen to the Controller into the Actor instead of grabbing it via some weird PlayerState ID?
- Why don't you just get the Owner of the PlayerState, which is the PlayerController?
And yes, LevelBlueprint should be avoided anyway.
If you need that logic in a different Level you are already forced to copy paste the logic and update/maintain it in more than 2 places.
ive always handled spawn and posses in gamemode and thought that may be his problem.
i didnt have the player state or id either
Idk what his problem is (in terms of what is not working) but the code in that image is basically worth throwing away.
didnt think about that being an issue
"GetPlayerController" is very likely not what they want to do there anyway
Just get the Owner of the PlayerState if you want the Controller that belongs to it
thats nice to know
And if that overlapping actor is an actual vehicle that can be possessed, then I'm sure it already has a reference to the Controller.
So the PlayerState->ID->GetPlayerController is totally redundant and probably wrong.
Unless it's randomly placed into the world. I don't know the context
But yeah, not surprising the code is not working
@thin stratus @soft girder what should I do
i just got the controller straight from the third person charcter
What's your solution
Sorry I don't know what you are trying to achieve. Didn't read anything despite the Image.
Just threw some thoughts into the round
this code is inside a box actor i made that overlaps all
it works for server and client
Like for your own code, i don't care. but if you show someone somethig, try to make it readable
thats just ugly and quick
Put a Sequence in there for example, so it's clear that destroy actor happens after everything else.
Anyone here used unreal simply for the rendering and ran the logic outside that then connected to a server?
Anyone here used unreal simply for the rendering and ran the logic outside that then connected to a server?
You mean replacing UE4's network and server architecture with something else?