#multiplayer
1 messages ยท Page 521 of 1
so you could define or drive the size
by passing to this shader a variable that determines how big your decal is going to be
@pallid mesa Thanks, will give it a try now. If you're curious, this is the effect in action, in my game: https://youtu.be/fNzlFwYikXA
that looks cool!
oldschool POGs action ๐
haha exactly - cleaning everything up and it's one thing that's bugged me that I couldn't find a way to prevent the spamming of the spawned decal, so hopefully by tonight, I can figure it out
will post back if I have any more questions - thanks again
no worries, there are more methods to do what you want to do
oh yeah? such as?
oh yeah, good point. I can just create a flat mesh of the shape (or even a plane with opacity mask) and scale it then it wouldn't be much different than the method I'm using now
that's a fair point ๐
@winged badger yeah, that is what I did
basically I found that the instanced subobject was created and properties were loaded on the server
and then the subobject was sent to the client
where the properties were not loaded
was it the replicated one from the server, or a local one?
however, since nothing had changed on the server (properties were loaded and left blank), the initial replication didn't have the changed properties
so it was constructed and then just left there
the local one
Server: Constructed, Properties loaded, Sent to Clients
Client: Recieved, Constructed, Properties not loaded (since it was sent from the server)
the step where the initial properties was skipped, because on the server they were loaded and never changed
normally, all replicated properties are sent with instruction to construct the object in the same bunch
not if they are default
and, honestly, this isn't the first time this has happened to me
so i shouldn't be surprised
you can make OnRep fire if they are default
but you can't force the server to actually send the property
instanced is fucked, when you put it on instanced subobject it gets even worse
oh ffs
"whistles... OH GOD ITS ALL SPIDERS"
server thinks the defaults are whatever you put into the instanced object on the actor CDO, because its instanced
yeah, if you have a DOREP condition to fire OnReps always, it actually checks if it's the initial construction and if so, fires the replicated property OnReps regardless of if there is actually something from the server
client receives "make this object, here is delta"
yeah
client makes the object from its CDO
i avoid using instanced like a plague nowdays
well, i like it
because I can subclass data
which is a vital feature of what im building
(I'm building a MP vehicle system that is game-neutral)
(so things like "does this seat do anything special when a player gets in, like animate the player" has to be on a per-game basis)
so, just subclass the seat config
any particular reason why a UObject, and not a full UActorComponent?
uh, lighter
and they don't need to be registered
plus, i'm doing some stuff with array manipulation
i think im just gonna duplicate the object
set the dupe to be net addressable
and replicate that
that solves my problem... it's ugly but it works
easiest way is
serialize the instanced one-> create a new one -> deserialize it from archive
i think
game agnostic, that a hobby project or a future plugin?
client work
and i have a couple of use cases
could work as a future plugin
but i have no idea how i would sell it
@pallid mesa - I got it working. Thanks for the assist.
Hello guys,
In the game mode class I'm trying to pass player state from a controller to another controller client function but in the client the player state is null
in my game mode :
void AMYGameMode::PostLogin(APlayerController* NewPlayer)
{
AMYPlayerState* NewPS = Cast<AMYPlayerState>(PC->PlayerState);
for (AMyPC* ExsitingPC : PCs)
{
if (NewPS)
ExsitingPC->UpdateNewPlayerInfo(NewPS);
}
}
in the controller class header:
UFUNCTION(Client, Reliable)
void UpdateNewPlayerInfo(AMYPlayerState* InPS);
void UpdateNewPlayerInfo_Implementation(AMYPlayerState* InPS);
in the controller cpp:
void ARTS_PC_Lobby::UpdateNewPlayerInfo_Implementation(AMYPlayerState* InPS)
{
if(!InPS)
\\Some log
}
Why the client can't see the Player state ? As i know the player state is replicated to all clients!
Update from my SeamlessTravel issue:
I have managed to get my character be carried forward to another level using GetSeamlessTravelActorList() but the mesh is not showing, please help
๐ @mighty rover
@ivory flame y don't u call create session on the server when it starts up? Then u could use sessions right?
@timid moss I don't fully understand how sessions work when I connect using IP address, because I don't know the way how to use Join Session with my dedicated server IP
Sessions are just information stored as a list you can retrieve
It requires a central place to store them, called a MasterServer. Steam for examples allows using theirs, which allows you to create and find online sessions. When connecting to them it just pulls the connection info from the session info.
@wet oriole most likely a timing issue. The state hasn't replicated to the other client yet
hello, are there some rules about when the OnRep will be called on the client side? For example if the replicated variables would be set before BeginPlay on server, would their OnReps be called before BeginPlay? Or OnReps just can come in any time and there is no rules regarding them?
If the value is changed from it's "default" value when the actor arrives from the Server it will broadcast the OnRep's
Hard to say RE them vs begin play, since if the game hasn't "started" yet then BeginPlay is halted anyway.
Client side: Spawn local version of replicated actor -> PreNetInit -> Set Replicated Values -> Call OnReps -> PostNetInit -> (if the World has/when the World calls DispatchBeginPlay) BeginPlay
Ah yeah cool, that's what I thought. So OnReps always first
@winged badger thank you
@empty axle if you spawn actor deferred, or use ExposeOnSpawn options in BP, you can use BeginPlay in a more generic way
as then server side whatever you plug in as ExposeOnSpawn or initialize between Spawn and FinishSpawning is available on BeginPlay, same as on clients
(as NetDriver doesn't send the Actor information the moment you spawn it, any replicated variable you set server side after BeginPlay, but on the same Tick, will be replicated before client's BeginPlay)
So the actor spawn info and replicated variables set with using deferred spawning are send as one bunch?
they are
well, anything you set between spawning an actor and netdriver sending it over really
which might not even be same Tick
That makes sense, so it is safe to assume that those variables would be available on Beginplay
in BP its same frame tho. in c++ you have flexibility to call Finish Spawning when you like.
same packet - either everything arrives, or nothing
if your replicated variable is a pointer to another replicated actor, there is no guarantee that actor will have replicated before your actor referencing it calls BeginPlay
but non-pointer types are completely safe there
those kinds of race conditions typically happen during non-delayed match start
OnRep for pointer types should still fire when their NetGUID is resolved on that machine
Hey just wondering, are requests using FHttpModule encrypted in any way?
For example, SSL
Hey, i am getting this error when i try to build from source (msb3075 exited with code 5). Any solutions?
Hey guys, I am working on a utility app for our UE platform, and I need to find any running instances of UE on our local network...I currently am able to scan the local ip range for specific open ports...but, when running a listen server, I cant seem to see any ports opening on my UE machine...
Anyone know which ports for sure are opened on a listen server, or any other open port by default w/ UE4?
@thin stratus Sessions are just information stored as a list you can retrieve It requires a central place to store them, called a MasterServer. Steam for examples allows using theirs, which allows you to create and find online sessions. When connecting to them it just pulls the connection info from the session info.So you can still use sessions with dedictedd server?

Yes dedicated server can and should and that's how it should behave,I haven't used steam anytime but coming from experience of Software Engineering and considering good design
Basically steams master server needs to tell your game we have found a match and steam is going to send you the found players and the dedicated server let them in via session
@timid moss
If you spawn 10 replicated pickups that are pooled on begin play, in order to update their location when moving to desired locations and resetting, should I use a RepNotify FVector property or just set SetReplicateMovement(true) so that clients will see the pickups at the new location?
They are simple static actors so there's not actual movement to speak of, just updated locations from time to time when the pickup gets pooled / reinitialized
trying to get the gamestate inside the player controller, its returning null, does one know how to fix this?
trying to get it inside the tick function
Why would you be doing it on tick?
Usually there's a bit of time before the GS is fully up and running so if you were getting it on tick there may be a few frames where it's null
i figured that after a while
its working now
im doing it on tick because i need to know if a round is over every frame
@limber gyro why would you need to know that every frame?
Make it event based it's far more efficient
i know but i cant be arsed
I feel like stuff like that is how some infamous games that are built on a house of cards are made
"do it the easy way, we can fix it later"
reality- can't fix later without breaking 10 entangled parts of the game
Can anyone help me with a gamelift issue? i ran
cmake -G "Visual Studio 16 2019" -A x64 -DBUILD_FOR_UNREAL=1 .. inside [dir]\GameLift-Cpp-ServerSDK-3.4.0\out and got no errors. Then i ran msbuild ALL_BUILD.vcxproj /p:Configuration=Release and got the following error:
The lines that it is referring to in Microsoft.CppCommon.targets is this:
I have a question for you networking peeps. I was wondering for network debugging is there a tutorial or a way to use wireshark to track the packets in flight from server to client.
?
I wanna test Client Side prediction because I wanna see how UE4 handles sending updates to the server if the clients frame rate is uncapped.
If i wanted to start to learn about making a persistent dedicated server does anyone have any suggestions on learning resources?
u would need to setup a database. actually u probably know that already
@fluid prawn I don't use wireshark much but I know there is this channel called Battlenonsense that does the kind of stuff you are trying to do
Yeah Brian i'm more looking for info on configuring unreal server builds , pulling info from those DB and writing to it, etc
if you are talkng about doing rest requests in game to get database values theres this. https://wiki.unrealengine.com/UE4.10_How_To_Make_HTTP_GET_Request_in_C%2B%2B
I have another question brian
regarding client prediction if anyone knows
if the server ticks at 60
does that mean the client will sample its own moves at 60
or does it sample it at its own frame rate
for the prediction right?
i feel like that since the server is authoritative
yes
so if you have say
100 ms
server has 20 ms
20 tick rates
then
16 ms to 100 ms means the client is 6 moves ahead of the server
but the server acks the client every third tick of client
so I suspect the client will sample its moves 3 ticks of the 6
and do the delta
the issue im trying to wrap my head around is if you uncapp your fps
and it fluctuates
your assuming that the framerate is what determines the distance your character moves. If you follow basic gameplay programming practices, the frame rate shouldn't affect your movement. You are supposed to multiply how far you move in a certain move by DeltaTime, that way your movement is dependent on time, and not your framerate.
or maybe im misunderstanding the question
yea you're right about delta time
so no matter what fps
you get the sum
at one second
in UE4 i see
they send moves
does that answer it?
the thing I am concerned with is what it looks like when the client sends chucks of information to the sever and fluctuating frame rates
i am confused about that
the only thing i can think is that
ue4 caps the sampling sent to the server by the servers tick rate
so if you have 120 fps and server ticks at unno say 60
it will chunk out 60 of the 120
yea that makes sense
but again i wouldn't think it would eb a problem because of deltatime
you send delta time
over the wire too
so yes
the thing is the delta time
sent
must be capped
so
1/60
so like
if i have a data set
of moves for 120 frames
how do you chunk that with another delta time?
muliply it by a scalar or something
every tutorial i've seen on client prediction is nice and always creates a situation where the client is capped at certain fps
but in the real world that doesnt happen lol
true. is this the Character movement component you are using? or are you making your own. I haven't gotten too much into that stuff yet so I don't have enough knowledge
i am overriding it
ive spent a considerable amount of time in the CMC
and I wanted to do some fast pased movement
with velocity
yeah i will be doing that sometime in the future and am sorta dreading it.
and i get jittery netcorrections
ah
I did this
might help you
https://github.com/staticJPL/UE4SequenceCharacterMovement/blob/master/UE4MovementNetCodeSequence.pdf
I mapped out the networking sequence for the CMC
i hvae made special movements before in a custom CMC but i havent gotten into what your doing i think
nobody really has lol
o wow thats useful
the netcode for cmc is like the monster under the bed nobody wants to talk about
its complex lol
the thing is for any character movement you cant actually build a template for netcode
for all movement
the only one template you can technically do so is for velocity based movement
is it the one with the max speed
and he overrides fsaved move n stuff
like they do in UT
yeah
ya i saw that
theres also this that was more recent https://www.youtube.com/watch?v=DoZyH86n_gs&t=273s
but yeah. im sorta hoping that by the time I'm finished with some of my other stuff Epic will have replaced the system with a better one. They said they were working on it so that it works with the ability sysstem
but i have a feeling that will take a while
they are recoding the CMC?
"Epic recently started an initiative to replace the CharacterMovementComponent with a new Network Prediction plugin. This plugin is still in its very early stages but is available to very early access on the Unreal Engine GitHub. Epic mentioned that they would like to have the plugin working by the end of 2019 but that is not a hard deadline, just a goal. It's too soon to tell which future version of the Engine that it will make its experimental beta debut in."
This was said a while ago and I don't think I've heard any real updates
Network prediction plugin
isnt it already
technically done
what interfaces are they exposing?
I suspect they are just making it easier to override the CMC
to work with net prediction
i assume they give you a framework
I remember hearing in #gameplay-ability-system that it would be integrated as part of it
the net prediction and you implement their interfaces with movement
i almost am sorta unmotavated to learn CMC because of the news
thats y im studying replication graph and ability system rn lol
I've been pissing around with cmc for a while it triggered me so much
cmc is garbage
i had to take a hiatus from it for like 3 months
it works, sure
but its terrible
ah i made my own replication graph
based on ideas from fortnite and shootergame
i haven't actualy made a serious game with it yet so yeah.
you said they made a branch of it on git
i might work on it
with them or something
I think for me its fine to override it and use it
you can enable the plugin
i can later port it over
when i went deep into their sockets code
it was really messy
to see how they move the pawn component
with replication
yeah i want to wait on working on movement stuff for now because im sorta waiting for the updated system, but at the same time when the new system is finally out it will probly not be ready for production use right away so im guessing itl be a while.
but knowing me ill probably not wait for it.
im probably going to use CMC
thing is i don't see much happening with it
in the git commits
with is either good or alarming..
wouldn't that be cool. not sure they would accept our PRs lol
as someones once said "someones gotta do it"
we should setup a branch
of ue4
and do it
would be doing a tim sweeny a favor
not just that im sure if there was an active community doing it
epic would intervene at some point
would totally do it if I felt confident in my networking skills. I'd say im good but idk about THAT good
it's actually not that bad
honestly at this point it feels better to build it from the ground up properly
than trying to hack the cmc
to do your bidding
if anyone is interested let me know
maybe rama wants in on it
the only issue and pain point is hooking in the animation stuff
I mean I guess its not like CMC is impossible for me to understand. I could probably make progress but would eat up so much of my time hahah. and idk about u but im still in college
root motion and such
If you want to get serious about starting a team for this, maybe consider creating a discord server for this effort.
I'd join the server for sure
I would I need to find people who are interested and want to
maybe i should just get the ball rolling myself or something
i think some parts of the CMC are reuseable
hmmm. I like your idea. but who knows. maybe epic has lots of changes they haven't pushed yet
but i doubt it
I wonder if someone here knows
whos going to be the one to @ him lol
๐
:/
haha
hahjahjja
funny joke
yeah i might
๐ฎ
๐ฎ
Dave Ratti is the guy working on it
same guy who worked on RepGraph and Gameplay Abilities
so hes a god
so it looks like
hes doing a seperate class
for sim
and a new base movement class
interesting
It's great. I've been using it a little bit (the master branch version). Still some rough edges but it's definitely going to be a game changer.
No more ripping character movement apart whenever you want to add basic features...
i just wonder how easy it would be to get AI system to use it
cause it would be so nice for our AI, which don't need all the complex CMC stuff
hey guys, is it safe to store access and refresh tokens locally? For example, if a user authenticates themselves through an OpenId provider and gets AWS credentials that will be used for calling APIs on AWS API Gateway, would it be ok to store these credentials locally? My worry is if the tokens get stolen, then someone can impersonate the client.
anyone know how to disable the rendering for a client that is run with the '-server' command line arg? I'd like to just run the server without the render window
@wild lagoon Last time I tried building gemelift it didn't work because Gamelift is not updated to compile with VS 2019, so I will ended up cross compiling for Linux and test things with Linux Dedicated server for UE4.23
wait really? i spent like 10 hours today trying to get it to work lol
@wild lagoon I didn't try that hard to build , as official docs of gamelift mentioned VS 2017 supported, so once it failed for me in VS 2019, I didn't bother as I just wanted to evaluate the platform so cross compiled for Linux and tested things out
Their Linux build instructions works fine
And anyways you want to end server to be Linux right, so better do it in Linux
Install VM Ware and build one
If you are worried about testing th dedicat d server on local machine then you need to be worried, you might be thinking you need a virtual machine or a Linux machine to run, but that's not the case
You can run Linux Dedicated Server inside you windows. Simply instance Linux Subsystem and run can run all Linux things in Windows including your Linux Dedicated server
@winged badger thanks for making it clear for me
so im trying to start up a dedicated server on linux
im told in the docs that the correct thing to do is something like:
sh ./TowerBattle.sh /Game/VehicleCPP/Maps/VehicleExampleMap -server -log
but unless i put ?listen on the end of the map name, it wont open port 7777 so nobody can connect to it, but thats supposedly 'different', right?
as in its also a client, and spawns a player pawn?
@chrome bay I m now attracted towards Network Prediction Plugin, just wanted to ask does it required to do additional coding to make it work with existing system like ASC, Replication. I have 2 days Saturday and Sunday and was hoping to explore it more.
it's not integrated with GAS yet
Sad to know
How confident are you that in upcoming release it will integrated in all respective components being still in beta
Because I don't want to touch CMC at the moment and I do have a lot issues with root motion.
It's not going to be ready for months, and I wouldn't expect a new character movement system for at least another 6-9 months, maybe more
Obviously this is pure speculation because nobody outside of Epic knows
And their internal priorities are always shifting around
Ya man u r right.
At least 4.26 should be safe to assume that it will have Network Prediction Plugin
I highly doubt it
Especially not fully integrated with the rest of the engine
It's still highly experimental, they might abandon it entirely between now and then
I wouldn't put any bets on waiting for engine features to be ready months or years from now, just use what's already in the engine
You could be waiting forever
What if if they were using it for fortnite internally
If they were we'd already have it
It's more likely they're doing it based on what they learned from Fortnite
Yeah you are right instead of waiting it's better to act on your own
Anyways I will explore it on Saturday and Sunday
Thanks
https://wiki.unrealengine.com/Standalone_Dedicated_Server#Compilation this template is invalid for 4.24 it seems.
i get an error that UEBuildBinaryConfiguration is not recognised any more. can someone please share with me a more modern version of the build target that compiles?
this one seems more up to date, damn wiki is a rats nest https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)#5._Target_file_instructions_for_engine_version_4.18
is all this faff really still needed for a dedicated server build?
separately building the server executable, and dragging stuff about, manually cooking half the assets?
All I do is package the game in editor as normal for the client, then build the server in VS
Then copy the binaries and pdb's from the Binaries folder accross
its starting to do my nut in
UnrealBuildTool : error : Server targets are not currently supported from this engine distribution.
seems to me its being stubborn and i cant make a dedicated server unless im using a source distribution of ue4
@meager horizon hahaha, you need source version it won't build
That's how epic designed the engine build toolchain
we've all got better things to do with our day than wait for unreal engine to build from source
and then to have to redo that each time theres an update :/
@meager horizon I don't agree on this with you, the source build gives a alot of insights to me
I do actually modify the engine to check why I m getting unexpected behavior
ive always tried to avoid modding the engine
It's one time process to engine rest is fine
It takes 30 mins to build the entire engine
In this time you could do 100 push-ups
@meager horizon I m working on mobile game, and blur doesn't work on mobile so I do modify Engine to make blur work on Android
I don't want to wait for epic to fix it. I raised a bug in 4.18 for blur not working and still its not fixed
ok, well this is my first dip into networking in ue4. i consider myself clued up as far as networking goes, but this is um... an adventure.
Sometimes I feel like these epic Engineer have become arrogant and thick skined after UE4 have become so famous, they only work mostly with good studios closely
They don't listen to common bugs at all.
i guess today im learning to build from source ๐
It's very straight forward
yeah i suppose when i want a new release i can just do a git pull
Yes that's it
so my game started out soooo simple
and ive gone down the rabbit warren within 2 days.
for example. lets talk physics and networking. how to lose your hair rapidly.
so i stripped the driving physics and vehicle movement component completely from my prototype and started making my own deterministic non-physics one: https://www.youtube.com/watch?v=M0fDhnufBlw
This video demonstrates WIP car movement behaviours, including independent 4 wheel suspension, 4 weel turning, wheel movement based on vehicle speed, positioning of vehicle to point up and down hills and tyre collision.
I still need to simulate turns tilting the vehicle to re...
but thats just the tip of the iceberg... ugh.
Yeah you need a source build to build the dedicated server
i wish it would just appear in my list of platforms
after ive got the source build built, i mean
I suspect it's because extra binaries etc are required, and they don't want to package them into the launcher version
rather than having to fanny around building a separate executable in vs then copying it into a packaged build
in theory building a dedicated server should take less dependencies than a listen server or client
not more
Yeah, I've never looked into why. To be fair though most games don't really use dedicated servers, or if they do they're probably already working from source and have a build setup anyways
Does seem strange though after all this time
im going to do it through a dedicated server to keep it all 'in house', in the same way games like fortnite are kept 'in house'
i have some non-ue stuff im going to tie into it
for authentication etc
but thats a long way down the road
Yeah that's fair. I'm not a fan personally, too many games launch with dedicated servers only then when the studio closes suddenly their entire catalogue is unplayable
looks at Paragon
lol, true
i suppose i could easily allow for custom listen servers without any extra hassle
you'd have to make a choice then, play on your friends or community run server, without the extra fandangles, or on the main servers with them
It's a good idea IMO. My usual intention is to allow for listen servers for private sessions, then for public use dedicated
when i say extra fandangles i mean stuff like cosmetic IAP etc
ive been dead against games like that for years, but im finding that people are more receptive to a free-to-play model than forking out a tenner for an indie game up front
it might even end up that i end up not bothering with the IAP side at all, depending on time constraints
@chrome bay are you allowed to share what youre working on?
Well.. day job is this: https://store.steampowered.com/app/686810/Hell_Let_Loose/
Project I'm referring atm though is my side one https://www.youtube.com/playlist?list=PLoozKjrfzhYaawZ8dNIkHP-US5Ddj5BC8
But the game it's based on is still alive and well today because of modding, so my intention is to be as open in supporting stuff as possible
It's also my original background though so maybe that's why I'm so open to it..
Also given the state of MP Indie in 2020 I doubt it'll ever get enough players to warrant a highly locked down server setup etc, I'll worry about that if it gets that far
i like the look of the tank game
in some ways it reminds me of tracked vehicles in starsiege universe
are you also going to do f2p?
Undecided atm, still not far enough along to really decide what to do with it
Long way to go
As a consumer I despise F2P, so we'll see ๐
hmmmm
setup.bat of the source build failed at 99% fetching deps ๐ฆ
web exception and big fat red error message
Hey ๐ !
Does anyone know of any good resources about network beacons ? I've been searching for a little while but I haven't found anything on how to use them. Alternatively is there a non Steam party system ( plugin, lib) ? The game I'm working on is only in local multiplayer. Thanks !
Does anyone know if you can hold more than one game mode on a server. For example, if you get a game lift server, and your game is 1v1, can you have 4 separate games on that server totaling 8 people?
As separate instances yeah
So 1 server can hold separate game instances? And not interrupt games that are in progress?
1 physical server can hold multiple game servers (instances)
Essentially you run the .exe multiple times and give each one a different port
It's something you do on the amazon/server side - not in UE4
@meager horizon I'm with you about the dedicated server stuff. yay more steps just to get back to actual development, seems like a terrible idea.
i followed this guide - https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)
and got it working!
However, when i made a third person project and actually joined as 2 clients on my local machine after running the server, I get some really hard stuttering every 2-3 seconds when just walking around. Can anyine help me troubleshoot this?
I've followed the same guide and I cant figure out how to make the server host online. When I have the server running, I check to see if the port is visible online and it says there's no service running on port 7777. What step am I missing to make this run outside of lan?
@lean flint have you checked ur firewall settings?
I have, its forwarded. I tested running a minecraft server on 7777 and its visible with that
Yeah it works perfectly fine locally
Is running the server executable automatically supposed to run the service on port 7777?
I didnt try that yet
Try that. And lmk.
Its possible that there is something stopping you from joining from a seperate pc.
Ok I'll do that. It just seems like I'm missing something here. How do I tell the server itself to run locally or through the internet? The guide doesn't show anything like this
I dont think there is a difference. But I'm still learning, so not sure.
As i understand it, its mostly where you place it and what you leave open to access it.(not that I'm an expert)
ok, thats what it seems to be
You now need to understand how the internet works with port forwarding, services/servers, ports, etc. The game instance is running on a computer listening on a port, ie waiting for a client to connnect and start the handshaking.
Are you trying to have the client connect to your machine outside your LAN?
im about to see if i can, transferring the client over now
and yeah Adam
my problem is that no services are visible on port 7777 when i run the server
Oh, I see where you did get something running on that port.
yeah so its forwarded properly
@stiff plank i can connect on the same network from other devices
Hmmm
So knowing that, the game instance is running correctly.
I am assuming the client runs and you can play the game.
yeah i was able to join into the current server game session
At a NetUpdateFrequency of 10 is it common for OnRep bools to just never go through? I have an important reset function that has to happen on both server and the client when a character is pooled and reset, should I make that a reliable Client RPC instead of an OnRep bool when reset on the server?
@lean flint sorry, I don't have enough networking chops beyond this point to be a help
np thanks for trying lol
@lean flint a weird problem. I am still a newbie as well, but i would try to isolate the problem with testing. Is it a network issue, or some issue with joining. Seems like a firewall problem, like unreal is blocked but minecraft wasnt somehow? Lmk if you find anything.
@shadow folio @lean flint when i made a third person project and actually joined as 2 clients on my local machine after running the server, I get some really hard stuttering every 2-3 seconds when just walking around. Have either of you ran into this? it happens when i join from the local machine as a client as well.
yeea the main issue is the service isnt being put on port 7777, or yeah something else is blocking only UEs service
@grizzled stirrup replicated variables can never be relied on to receive all incremental changes during gameplay - they can only be relied on to always contain a "recent" value for a variable. if the important feature of a variable is to be each separate change of its value, the only way to do it would be a reliable RPC
i havent gotten any stuttering when messing around locally
Thanks HoJo, the bool is only set true on spawn and false on death but it seems it does't go through 100% of the time
I'll move to an RPC
@stiff plank It has been quite a while but I don't remember any problems, but then again at that time I was not trying to accomplish much in the game either.
damn, alright. Thanks anyway.
@stiff plank ur experiencing stuttering using the standard thirdperson project?
yep, after i built it as a dedicated server
i run it, and when I join, stuttering when i walk
is it like desync stutter? or fps stutter?
like moving around locally looks fine, but from client to client it seems like the actors are stuttering?
how can you tell the difference, turn on fps counter?
yeah
let me double check quick. Can I just turn on my comps fps counter or does it have to be unreal?
or its desync somehow if the actors arent lining up perfectly
i would just use unreals
kk give me 1 sec
@grizzled stirrup weird, but might be related to net relevancy too? I think reliable RPCs are always sent regardless of dormancy/relevancy too whereas rep'd variables won't be (don't quote me on that)
lol, im not running into the problem now. I gotta investigate more. wtf ๐
heh, why can't problems be consistent? ๐
this is from the dedicated server guide. what this guy crossed out should be the servers local IP right?
I would think so
Micro optimization question, I increment a NumPlayers int32 on PostLogin in the GameMode, but after seamless travel, this number would not persist as post login does not get called again past the first time a controller joins the game, correct?
The better question is: Why are you counting them yourself?
What do you mean?
I can iterate over all controllers to get the count, but thought it would be nice to get a count once at the first post login and use that for the rest of the game (including through travels)
Oh there's a helper function GetNumPlayers() that does that iteration in a function already, I was just trying to avoid iterating every time I need the value and make a one time cached value at every seamless travel
I inherit from AGameModeBase, don't think that array is available there
That's a GameState array
then you can't use that ๐
Filter them by !IsABot
yeah or just use the loop, controller iterator is quite cheap anyway
I always hear the scary never use get all actors of class etc. but this iterator does seem cheap since I'll only have max 4 players
So will use it for convenience
Thanks!
I suppose GetAllActorsOfClass etc. are only to be avoided if frequently iterating over large actor sets
GetAllActors of class can be okay. It's just not good to use it in case you can't get a ref otherwise
I don't like beginners to use it to get refs
I usually use it for example on the AI to get a list of players to find the closest one, or a list of spawners to choose the best one etc.
I could have the spawners report to the GM
And populate the array
But I believe if they are only reporting / the GM is only iterating once on begin play, it doesn't really matter
As even a slight hitch before the match has started doesn't really make a difference
Will try to keep all my heavy iterators on begin play, at least the upfront cost doesn't affect gameplay
i use TActorRange
YEsss
I'm about to convert all my iteraors to that
But not once off
exactly
Or very rarely / event based
i cache a lot of stuff on begin play
like minimap for example
grabs all actors using TActorRange
then actors are added themselves via the DynamicMinimapComponent
its mainly for static actors pre-placed in the world
Nice yeah I do the same for enemy spawners / spawning all loot etc.
So it can be slow, doesn't matter
Once it's done it's done
yeah profile it
you will be suprised, its not that expensive, just gets expensive if you have 50,000 actors and doing it every tick
๐
Right yeah I'm always wary of stuff but in practice these things aren't even denting the FPS count ๐
Yeah I can definitely notice a hitch if iterating + spawning 100+ actors
But luckily that only happens once on begin play
No need really
eek
we do, we spawn 100 monsters at start of game pre-placed in the level (random spots)
we defer the spawns
Server goes from 300 to 60 back to 300 fps while the "MATCH IS STARTING IN 10" message is shown
Good idea though it would then mean there's no hitch at all
spawn them closest to players first, then spawn the ones further away last
Do you do a timer so spawn X then in a few frames spawn the next batch?
i create a timer for each spawn, next spawn does rand float .05 to .1f
and repeats till its done
Nice yeah I love that kind of stuff
Do it for all AI tasks etc.
So everything is nicely offset
same as my wave spawner
And also have pooled all my enemies now so the spawn only happens once
And pooled pickups / damage numbers
No more constant spawning / destroying!
yeah, we haven't gone fully pooled yet
Was a nightmare to find all the bugs though
that is next on my list
Invisible pooled characters being active on the client
Honestly it probably won't make a big difference but I spawn in large groups and did notice if I kill 30 enemies at once and 30 more spawn there is a hitch but with pooling almost nothing
Then again
Deferred would fix that
yeah but we have a wave system, spawns the monsters for that wave. We also have constant wave, where after X monsters are killed, X more monsters are spawned
but again not all the same frame
Yeah I'd be very curious if pooling helps in that situation
Let me know if you get any numbers on it
Just feels nice though
but we don't see noticable hitches
Especially for other things like the UI damage numbers
Just knowing they aren't constantly being spawned / destroyed is nice
yeah we use external damage number actor
not linked to the hit actor
handled locally
Nice yeah I spawn 10 locally and just rotate them via pooling as needed
If there isn't one available due to 10 being used, I don't spawn any
Well if you damage 5 actors at once in my game I want to see 5 damage numbers
handles upto 100 hit numbers
Oh right you mean the actual actor spawnign the widgets
I just have 10 widgets
And the PC handles them
PC for me handles the client RPC confirming damage
So was easist to do it there for me
By the way when you say deferred, you are still spawning regularly and not using theBeginDeferredActorSpawnFromClass right?
yeah but the player controller spawns that actor
and holds the pointer to it
locally
it creates the local actor
Yeah I just do the same without the local actor step
And hold the array of widgets on the PC
2 lines ๐
But yeah I know what you mean
I have a phobia against adding extra actors
So I usually bloat if it's reasonable
My PC is fairly small and reasonable at the moment only 800 lines
PC in my case relays damage information
So I have it talking to the HUD
and passing through any info needed when you deal / take damage
i just have a static function
ShowHitDisplayNumber(HitActor, EffectContext, etc)
can be called from anywhere
On the local actor?
local only
Nice that makes it more flexible
its a gameplay static
UKaosStatics::ShowHitDisplayNumber(HitActor, EffectContext, etc)
like that
Mm yeah love statics
I have my utitily class like that
For common stuff
Like align to ground normal
i have FKaosMath lol
Thinking of making a debugging one too
It's a lot of fun reusing the common logic
Feels efficient
Btw about this: when you say deferred, you are still spawning regularly via SpawnActorFromClass and not using the BeginDeferredActorSpawnFromClass right?
Afaik the deferred one just lets you change some properties but still spawns on the same frame
i use spawn deffered, but only to adjust stuff before spawning them
and that is not true
Oh right yeah you can call finish whenever
you can call FinishSpawning 5mins later
only in BP is it same frame
{
FString RetString;
if (!TestActor)
{
return RetString;
}
switch (TestActor->GetNetMode())
{
case NM_Client:
RetString = FString::Printf(TEXT("Client:"));
break;
case NM_DedicatedServer:
case NM_ListenServer:
RetString = FString::Printf(TEXT("Server:"));
break;
case NM_Standalone:
break;
case NM_MAX:
break;
default:
break;
}
return RetString;
}
Is there a benefit to setting stuff before it finishes rather than setting that same stuff post spawn?
this is a handy function
That is very useful!
when im logging
YEah for debugging
i can tell if it was server or client
Really nice
player states don't have references to controllers, right?
not direct one
unless you changed it manually, GetOwner() will return the controller though
nope, would work on owning client as well
Is there any tutorial about multiplayer AI with blueprints? I found one, but even the guy that records the vid doesnt know at all about AI and replication lol
you do the AI logic as if you were doing single player, for the most part
all of it runs on server
But when I tell AI to chase the player, it only chases the server's pawn
Hmm, so player reference should work
Thanks
Using the getplayercharacter/pawn/controller works without "run on server" replication (tho i dont need to use it just tried) but only chases server, either way i cant make AI follow any pawn without using "get" nodes
that is terrible
client telling AI what to do
1 reliable RPC on Tick per player per client
point of AI is it being able pickup on whats going on in the environment
then "decide" on what to do
i know haha, you always hate my "tick" nodes on replication i was just trying if it will work this time
tried my luck
GetGameMode->GetNumPlayers->ForLoop(0, NumPlayers-1)->GetPlayerCharacter[Index] will iterate through all player characters
GetGameState->PlayerArray->ForeachLoop->GetPawn as well
whats the point
every character on every machine runs that code
every character on server, every character on every client
and there is no guaranteed order for ticking
i understood, point was to check if i misunderstood the replication, i am studying it about 2 week or less
and reliable on Tick is pointless, it just overwhelms the reliable buffer and fucks up even worse when a packet is lost
i know, you said that before
then if it didn't resend it
for example
GetGameMode->GetNumPlayers->RandomIntegerInRange(0, NumPlayers - 1)->GetPlayerCharacter[RandomInteger]
will set Ai chasing after a random character
put it in SetTimerByEvent, 10, looping true
and it will pick a random character to chase every 10 seconds
Directly setting a replicated variable as a client only changes it locally, correct?
๐
and if this is blueprint, OnRep will fire when you do that, on that client
correct
i hate that ๐ฆ
and in the OnRep, you have a function param that tells you the previous value
Only in Cpp I thought?
correct
Wish that was in blueprints ๐ฆ
i wish it was not making local "replication callbacks" in blueprints
just feels completely alien
would be nice if someone figured out how to turn it off
I'm having issues with a RPC from client to server not getting called. The owner is set to the character but does not seem to get called
BaseWeapon.cpp
void ABaseWeapon::Shoot(float Spread)
{
ReduceAmmo();
bInstant ? FireInstantBullet(Spread) : FireBullet(Spread);
UE_LOG(LogTemp, Warning, TEXT("About to call SERVER_SetActualAmmo. My owner is: %s"), *GetNameSafe(GetOwner()));
SERVER_SetAmmo(Ammo);
}
ABaseCharacter.cpp
bool ABaseCharacter::TryToShoot()
{
ABaseWeapon* Weapon = Cast<ABaseWeapon>(CurrentItem);
if (!Weapon) {
return false;
}
bool CanIShoot = Weapon->Ammo > 0 && !bReloading && !bChangingWeapon;
if (CanIShoot) {
UAnimMontage* MontageToPlay = bAiming ? IronSightFireMontage : QuickFireMontage;
MeshFP->GetAnimInstance()->Montage_Play(MontageToPlay);
float Spread = MovementRecoil(Weapon);
Weapon->Shoot(Spread);
BaseWeapon.h
UFUNCTION(reliable, Server, BlueprintCallable)
void SERVER_SetAmmo(int32 ActualAmmo);
@chrome bay I m exploring the Network Prediction Plugin, and they do have an example for GAS integrated with Network Prediction Plugin.
My bad I didn't see the Mock Part, I got happy by seeing "Ability"
Don't suppose anybody has experience remapping a net GUID for an object on the client do they? E.g, say I want server updates for a particular object to actually map to another object of the same class.
could try IsNameSupportedForNetworking and Rename, maybe
its on the risky side though, one tiny error and clients get booted
Hmm yeah, that might work. Yeah it's quite nasty either way
i'd give it about 20% to work, as i don't think unreal will send a name more then once
i'd cache the NetGUID with UObject* into a map somewhere
I have pooled projectiles which all works nicely, now looking at predicting the fire client-side. Since server/client could choose a totally different projectile from the pool atm so I'm thinking about swapping the ID on the client
but can't say i read that part of the code
Yeah me neither.. will be an interesting experiment I guess..
projectile is an Actor?
yeah
you could physically swap the Actors
So I did think about that, but my concern is swapping all the state and particles etc.
Although hmm, I guess I could just move the particles around too
it is less risky then swapping NetGUID
yeah definitely
Hi all, I'm running into an issue that I sort of expected would have been common, but I can't really find anyone talking about it. Wondering if anyone here would be able to help me understand why its happening and/or provide a fix.
I run a dedicated server, clients join, then one of the clients uncaps his (clientside) framerate limit (t.maxfps 99999), and suddenly, that one specific client starts warping all over the place when they try to move - everyone else is fine (server framerate cap didn't change, nor did any other clients). Surely UE4 must be able to allow clients to run the game at the highest framerate they can pull, while functioning fine in a server with other players? I'll also note that all my custom BP logic works perfectly fine at all client framerates - it appears as though the only issues are with movement, which is using the default UE4 CharacterMovement component. Is the stock CharacterMovement component using tick for some reason? That seems strange if so, but I can't think of any other explanation :\
I've also tried using the Smooth Sync marketplace plugin for replicated movement instead of the stock UE4 character "Replicate Movement" setting, and am still having similar issues
Whats the macro name for a "run on client" replicated fucntion?
im having a bit of an umg multiplayer issue
maybe you guys can help
im trying to make a kill feed, i have it nailed down because ive done a chat before and its not so diferent, the issue is i have to call a blueprint function from c++ to add info into the killfeed umg, but blueprint implementable events arent compatible with networking
what would be the best way to acess the UMG function then?
@weary zephyr Most likely you're sending way too many moves to the Server in a short space of time, or if you've modified character movement somehow and it's not been done in a way that works properly with networking (that has to be done in C++ 99% of the time)
At extremely high framerates you will also exceed the saved move buffer very quickly.
@limber gyro UMG widgets cannot be used over the network or use network events
i know
im calling what i need in the player controller, and then it just gets the umg and calls the umg function with the parameters fro mthe server
You can't get the widget on the server because it doesn't exist
@chrome bay Hm, the client will be sending a move to the server every frame?
is there any way to separate that from the framerate?
@weary zephyr It tries to combine moves together and throttles the send rate, but yeah ultimately it does that
And no there isn't
im not gettign the widget on the server im getting in on the local player controller
I haven't modified character movement at all (except implementing a crouch function, but this happens when you're not using crouch)
ive already done a chat system i know how the netowrking works, my issue is mixing the blueprintimplementableevents with networking
Crouch functionality is built-in so if you're using that you should be fine
I'm a little at a loss at how I'd go about fixing it though - do you have any ideas? Surely UE4 can function properly while allowing clients to run their local game at 1000 FPS for example
Not really
The client has to save a buffer of moves, one per frame
If they're simulating at such a high framerate that they exceed the move buffer before the server acks/corrects a move, then they will be hard-snapped constantly
It starts causing issues when clients go over 144ish FPS (not sure the exact value, but it's around that), would running the server at a higher framerate (or changing update rates somehow?) fix this issue?
the question is, why do u need to have such high framerates? is there no way to achieve what you want without that?
Clients generally like to have the highest framerate possible, especially for competitive games
They do but you have to set sensible limits
and if the engine can pull 1000 rendering framerate, limiting clients isn't something I want to have to do
You can increase the size of the saved move buffer
especially to something as low as 144
But 1,000 is never going to work
How would I go about increasing the size of the saved move buffer?
If you look at the output log, you should be seeing a lot of messages like this:
CreateSavedMove: Hit limit of %d saved moves (timing out or very bad ping?)
144 is more than enough, our eyes cant see more than 125 i think
@limber gyro there's a lot of misinformation (and partially correct) information out there claiming what "our eyes can see" ๐
and most peopel dont even have 144hz monitors to get a benefit form those frame rates
You can modify the size in FNetworkPredictionData_Client_Character::MaxSavedMoveCount and MaxFreeMoveCount
Ultimately however, it doesn't matter
In the real world, clients are never going to be connected to a server where they are reliably getting updates at 144 Hz
96 moves should be plenty for 144Hz though
im not saying your not right, i just think your gonna have way too much trouble for somethign that isnt even worth it
Talking about competitive games, 144Hz is usually a minimum - people will be playing this game with 240Hz displays, limiting clients to less FPS than their monitor display rate is really, really bad ๐ฆ
Unless moves can't be combined
In the real world, clients are never going to be connected to a server where they are reliably getting updates at 144 Hz 96 moves should be plenty for 144Hz though
I'm not sure if I understand this right
I'd be entirely fine with clients sending updates to the server (and receiving updates from the server) at 100-144/second, just I want the local game running on the client system to not have an artificially imposed limit
You will have to put some limit in place
even 60 would be fine for the network update rate
is that configurable in the character BP or will I need to dig into the source?
if a player has 9999 frames he cant be sending 9999 packets per second to the server, that alone would probably make a DOS attack lol
YOu will need to subclass CharacterMovementComponent and use a modified FNetworkPredictionData_Client_Character
As I said the component will not necessarily send a move every frame. It will combine moves into single packets if it can, and send those at a lower rate
im not sure how unreal is sending packets to the server but i assume its on a per frame basis
@limber gyro yeah, I'd be fine with sending 60 packets/second to the server, as long as the client was rendering the world at X FPS
it has to be capped
thanks for the help @chrome bay I'll give that a try ๐
for that you would need to have 2 independent clocks
@limber gyro sending updates using framerate seems like a really awful practice
You just don't call the RPC every tick
im not even sure how u would do that
You don't need two clocks
I have tick disabled on my character BP ๐
but hes using movement component, he has no control on how stuff is sent
This is what I'm saying, the movement component will handle it itself
Unless you have done something which prevents moves from being combined
I even tried the Smooth Sync marketplace plugin
Unless you have done something which prevents moves from being combined
I haven't done anything like that
Smooth Sync is fundamentally different to how character movement works
Yeah, thats why I tried it
but unfortunately still had framerate issues - on SmoothSync, the character just didn't move on other clients
but worked fine locally
(as in, I could walk around on my screen, but everyone else would see me standing in the spot I spawned)
Even if it did, you wouldn't have any client prediction
In a real-world scenario it would have huge input lag
That's what Character movement solves
Well with Smooth Sync I was allowing the client to own their own pawn
In which case the client has full authority then and can easily cheat
so no input lag, but other players did have a bit of a delay on my pawn's movement
yeah, that's fine for this use case
actually it's what I wanted - fully client authoritive movement
In a competitive high FPS game?
If you want that, just disable client corrections in the character movement component
you mean these?
Bottom one
Just means the client will have complete and total control over where the character is
oh i thought you had to do somethign else
It will still send moves to the Server however
i already have messes with those
dont u have to set bServerAcceptClientAutoritativePoisiton to true aswell?
I've legitimately been looking for months for a way to do that, apparently I'm just an idiot ๐
Man, that's really annoying me now ๐
I mean it goes without saying though, unless you have good reason to, you shouldn't ever set it to true
I had 2 projects over the past 3 years that I ended up scrapping, and a large part of the reason was due to not being able to figure that out ๐
It opens a lot of cheating potential and I totally get that
Giving clients full authority is basically asking people to cheat
ur suposed to set it to true when u need to move very fast for very short periods of time
for some specific use cases, that's not as big of a concern as other issues
Well, it's a hack for that really. You can modify it to work with faster speeds
Just an easier option
ye, for me it works fine, i cant be arsed to mess with custom movements, documentation is outdated and it looks quite messy
compatibility with garbage connections that are dropping packets and have unstable latency, some types of games where cheating isn't a big issue (MP puzzle games or something), games that handle anticheat in another way, etc
Yeah but in fairness if it's a competitive game and they have a terrible connection, tough luck for the player
Haha yeah, fair enough, in most cases you're probably right ๐
Put it this way, we have maybe a few thousand players CCU on our game - and already there are rampant cheat programs and scripts out there for it
going to test how clientside framerate affects stuff now
Unreal being open-source makes it even easier for people
Yeah for sure
well now a days you dont make games taking into consideration bad conection, its not 1990 anymore lol
I remember with Cube 2 and Tesseract, cheating was a HUGE issue there because 1. they're open source, AND 2. clients have full authority of not only their own movement, but over whether or not they hit opponents when they shoot
Yeah.. they asked for it then ๐
Division 2 was another example also IIRC, more higher profile one
favor the shooter is common in fps's
Favour the shooter can be done without giving them authority over the hit
thats a bit over my head tbh
the client is still being warped around when they stop moving
the server log?
client
try setting bServerAcceptClientAutoritativePoisiton to true aswell
is there a cvar for verbose logging somewhere? I'm not seeing anything related in the console
That one I mentioned is a warning so it should come up regardless
The pawn is properly possessed by the client too right?
And input is being added via AddMovementInput?
yeah that's fine then
Does event begin play not get called on PlayerControllers after seamless traveling?
possess should be done properly? I'm using a marketplace kit, but I'm looking at the BP now and it seems to be configured properly
@grizzled stirrup Possibly not, the controllers are kept
bServerAcceptClientAutoritativePoisiton where is this?
Oh if it's marketplace... good luck
Thanks just going through the GM code now, I think it may miss the begin play call post travel
well it's a marketplace framework for the gamemode, not much else
i set it in code, but u should be able to set it in the constroctor or begin play
but the possess node is being used when the pawn is spawned
targeting the player's controller
drag ur character movement and search for that vriable
bServerAcceptClientAutoritativePoisiton on character movement?
ye
yeah I did, still nothing ๐ฆ
Yeah, I will, was hoping to avoid that ๐
I have the source generated for my project already, so I should just be able to do the edits in visual studio, save, and compile/build from the editor, right? Sorry, I'm not familiar with the C++ UE4 workflow much
you should
depends
if you change stuff in the .h ur gonna need to rebuild
not sure if u need to rebuild too if you change the constructor
but if you change it in the begin play you can just build from the editor
If anyone is searching in the future, begin play does not get called on the PC when seamless traveling, only the very first time it is loaded in the map
@limber gyro going to ask a dumb question because I've done barely any UE4 C++ ๐ I made a new C++ class to extend CharacterMovement, how am I supposed to go about setting that var in BeginPlay in C++? ๐
you dont need to extend
go to your character class that comes by default
and it should have a tick there
since its only for testing it will do
GameNetworkManager->ClientAuthorativePosition
bServerAcceptClientAuthoritativePosition is transient anyway
You can set it in the games DefaultGame.ini
virtual UPawnMovementComponent* GetMovementComponent() const override; in Character.h?
Oh
do u not have a class clled "urprojectCharacter."
Oh yeah, I do
ClientAuthorativePosition=true```
No need to mess around in code
There are a lot of other settings in that class too
related to throttling etc.
Man, I've been using UE4 for a few years now so I'm pretty experienced with it, but still, every time I try to deal with replication/multiplayer, I feel like I'm back to knowing nothing about it ๐
Thanks to both of you, I'll test that now ๐
Ok so it's miles better now, but it still seems like there's some correction going on
and I'm not sure why - with those 2 options, shouldn't the server never be updating my local client on my position?
i belive so, but there might be some other stuff that u need to set
unreal is simply too big
Yeah, it's huge ๐
Hm, this is very weird
I thought Smooth Sync overwrote most (if not all) of the network related settings in CharacterMovement, but with the 2 options you guys said, plus SmoothSync, it's almost working flawlessly
It seems like Smooth Sync isn't replicating control rotation properly like the stock component does, so I need to handle replicating the player's third person pitch separately, and some animations are a little buggy, but clients aren't warping around on any framerate
When setting the owner of an object such as a weapon, should I set the owner as my character or the playercontroller?
Multi feels like quantum states a lot XD.
anyone know why I'm getting crashes with dedicated servers on Unable to load package (A:/Epic/UnrealEngine_4_24/Engine/Content/Animation/DefaultAnimCurveCompressionSettings.uasset). Package contains EditorOnly data which is not supported by the current build.
from what I understand its saying that things were packaged editoronly, but why is the server trying to use this?
I figured it out, was in the wrong folder, derp
Hey guys do you know any good cheap relational database services? I'm trying to choose one for my games. What do you guys use and how is it?