#multiplayer
1 messages ยท Page 328 of 1
or am i lacking brain cells or what because the log window wont pop up
NVM
figured it out omg
the shame
Oh your doing this in editor lol
is there not away to stop clients auto connecting when ur not using single process mode?
What are you testing?
You can simulate
And the posses
Working at a help desk I find it's always best to know what someone is trying to accomplish before going down a rabbit hole to assist as sometimes they are asking the wrong question ๐
Sorry haha
Im just testing having two servers running
MAP_1 and the other on MAP_2
being able to join MAP_1 from lobby level
and transition between MAP_1 and MAP_2
Apologise for slow reply ^^
some reason when im booting up though im automatically connecting to the sever hmm
I think ima just have to package them as dedicated servers i dont think i can test it out the editor haha
you cant change maps when you PIE, need to test as standalone for that
Running two dedicated servers seams to not be happening haha
Unless im doing it wrong
You trying to use a non source version and run them? Like still trying to figure out the overall concept here for testing this
Yeah
Thats the nail on the head
Im updating my source version as we speak from git
trying to lobby from one but use another for game?
Yeah kinda
its really just the concept
of traveling from 1 server to another
Im just intrested to test it my self, and see what its like,and then see how my server machine takes some stupid load
Ah
Iv got a dual Xeon 2670 with ugh
i think its just over 1tb of ram
in it
So im just setting up some dynamic logic
and i want too see how far i can push it
Dedicated servers are pretty light like gig ram
Yeah true
But you can only have 1 map running at same time right?
So a intresting work around for say something that uses instances for example
would be having a master server control and launch maps by starting up another server with the required map
It would be really intresting too see what u could do
Even have the dynamic server index and boot up maps when needed
and even control Server core assignment and priority depending on the maps server load
So one player can be on one level and another on another?
Im really just pushing and testing too see what can be done
Yeah pretty much
There not in the same world, but there in the same cluster
if u get me
Its really just testinh things and pushing stuff too its limit, i think im also going to use this and write a small article on it for my college exam & post it on the ue4 for people to know about
Iv got a feeling the bottle neck is most likely going to end up being ram speed
Moving so much information around
the nice thing is though if its all on a local machine or cluster, if the database u store information on for example is on the same machine/cluster
Retriving and saving data would be very fast
Currently the OS runs on raid speed setup
Then the basic storage and database runs on raid backup
and then the storage from where servers launch run on m.2 drive
sorry if im getting carried away haha
Iv just super curious to test this for ages and see where the limits come in
I feel like as well, if u split the servers up in to chunks the processing power would be WAY better than just 1 big map for example
Because of threading limit issues right?
np with xeon 8 core x2
lower load on each server.exe tends to be better than huge single thread load on one
But this is all speculation until i actually try it haha
intresting though right? ๐
Well i mean it might be a super cheap ef way to handle it
It could be used on tiny scale or hugw
I wonder tho a lot of overhead in games comes on a local scale unless there's a billion objects to replicate and cull
If it works il happily hand it out least i can do
It's all transforms numbers crunching
Main cpu gpu use is local to render stuff
I just gotta figure out the right way to get this ball to move from local to interopt with servers version in an acceptable rate
true true
luckily for me, i have setup my project so i bearly have to replicate animation
Almost like it should only fire the interopt when it's interacted with and go with the simulation till an event
yeah haha
well
think of it this way
u only need to replicate the first point really
let the interp do the rest of the work to point 2
to some degree
Yeah that's what I'm thinking
heres an example i guess
Say your running and kicking ur ball
and u kick ur ball to ur mate
Everything works good other then feeling the jnitial lag of interaction
then u keep running
and your char decided to slow down and u have a slow down animation
like the client handle it
when the server updates velocity of there char
the client can say
Okay this pawn is slowing down
Lets start blending the foot break animation in
not the best example but u get me
Yeah
no need to realyl say
lets replicate this animation over!
who cares if the breaking animation is 0.2 out of sync?
it a int important
is is not*
Im no expert though, so dont listen to me LOL
Yeah mine is positikn really since all I'm doing is changing velocity of an object and it's simulating the rest
i cant really advise you too mush though as i dont use root motion
and i RARELY use animation bp
So at impact and for a second after it has a point things could be misaligned
i handle all my animation with a custom system
This isn't even animation it's a non animating actor that is simulating physics
ah
could u not have a slightly larger hit box on ur object our of ur normal object
and when it goes close to interfaction
rep notify and update
A ball so getting a local version to move when a llayer interacts with it with lag and then sync up smoothly with the server version is then tough part
so u send extra information when its about to have an important event
so u make sure the angle wont be off
u gotta believe man
Because if you use normal movment replication you click and .3 seconds or depending on ping then you see it move
im guessing u cant simulate on client and then kick the ball on the server
and update from server to clients?
But if I can make the client version move local and it's accurate enough it can interopt to where the server is and proceed
everyone will get a gist of the same thing
iv got no idea if this is relevent to your situation but it kinda reminds me of something i do
So i have these flying ships right, and when u fly around in third person they use inturp on client side only right for them swinging slightly left, right, up down, rotation left and right and up and down etc
to give really nice movement
right
but i dont replicate most of it
only hit box stuff
then this issue comes in to play
there body of the ships rotation
I think what compounds the problem is there is a trail emitter and you see it go jagged on first interaction because for the moment you hit it on your side it moves forward then corrects and you see the matrix rewind lol
is never in sync with the server right
so line traces are gonna be off?
but what i do is
I fire the guns from the front of the ship to the center of the screen cross hair
on the client
but on the server
it fires directly from there camera center to the cross hair
my point being
visually its totally off
But it dosent matter because
its only slightly off
but the effect the end result matches up
not sure if iv exaplined that very well
Yeah it's all smoke n mirrors to give the illusion of correct in close proximity
but its something iv come to understand recently
Yeah haha
U got it
as long as we get a same end result
the start can be slightly off
im guessing rocketleague
does something like
finturp updates the ball
on peoples screens
thats why the ball when people play
does not really when u think about it
work even close
to how it world work on just the client side
Iike swapping B between first person and third person two different skeltons
the physics are like
kinda not right if u get me?
when they boot the ball around
so guessing why its slightly off is some sort of inturpsmoothing
maybe
I'm gonna try and get some inside info from my bud there to see what they do.
Dont forget though man most important thing iv learned
is there many ways to do things
wait dude
haveu ever seen the post umm
the multiplayer physics setup
on the forums?
Maybe
that game thats like
4 arms
and u wack balls
or some crap
its just basics of physics replication
Haha maybe not
I set linear velocity and add angular if I want to change its soin
Scroll all the way to like his last post with the full project
u see i orignally used physics
for my flying ships right
and i just ended up sacking it off
My game does this though you have a range and it is basic overlap sphere click a button gets overlapping actors if actor is in angle and between distance sends message to that actor to volley
The volley sends the forward vector and players velocity
It uses that to then set its new linear velocity
dedicated or host player?
Nah 2v2-5v5
Depdends on the mode one mode is designed around peer to peer the other desicated
tbh man with such little players
u can prob just go fucking ham
on the math caculation
just make it all work and forget about everything else
then profile
Because its some huge range project, u wont have much backlash changing things
because its not*
but also on another note dont listen to me
Lol
if im planning to spaawn 500 servers and idk wtf im doin
and ur kicking a ball
i think u got this fam
I'm not selling anything so I don't care bout backlash lol passion project someone doesn't like my vision well ue4 is free to try and program the game you want ๐
ahh ok on the comp lets get to work
gotcha man
btw whats the correct command to join a session already in progression? and is there any presetup to let people join in progression
just thought id get point in the right direction before i dive in ^^
unsure on that, i use open ip for things
i tried open 127.0.0.1
but it does not seam to be working
i did preset the other client to Lobby?Listen
hmm
yeah, i only 1 instance open rn
im prob doing it wrong haha
wheres that wiki page gone >.>
So I got a bunchs code to rewrite as I'm doing no dedicated and watching things client vs authority. Need to make sure it matches ๐ nap time first!
haha okay!
Is there anyway to erm
a server to tell a client to join another server?
so they cant cheat it
when u join and excute it on the server, obviously the client does not run it, but they need too
or when u run on owning client, can that not be cheated?
Does anyone know how I can have code only appear on the dedicated server but not the client?
#if UE_SERVER
For Server RPCs, does _Validate get called, even if the Server is calling the RPC?
I'm studying how to use UE Network Profiler, but didnt find good sources yet.
How did you guys manage to learn and start working with NP along with the development of multiplayer crucial features? Any blogs, threads, useful documentation/books to start looking at?
btw, I've only seen epics doc, and it has some information, but by your personal experience, is that enough to learn properly this tool?
(https://docs.unrealengine.com/latest/INT/Gameplay/Tools/NetworkProfiler/index.html#performanceview)
Tool for displaying network traffic and performance information captured at runtime.
#if UE_Server doesnt work. Instead the code is shown only on the client and not the server
what.
Yeah i dont know why its happening only on the client
Is is possible to set replication per connection? Or by demand?
hey guys, anyone in here that can really make complete games like Tower Unite for instance, but then a lot simpeler gameplay wise? with databases and log in systems, and saving high scores and saving user data on a database and everything like that?
@elder ravine yup
@proud hemlock You can control what conditions an variable will consider before replicating.
OwnerOnly
SkipOwner
SimulatedProxyOnly
Etc etc
@proven meteor Try looking at Exis Networking Compendium. It should be pinned to this channel.
@pale vapor _Validate is called by the server for any RPC call regardless of where it came from.
Has anyone here managed to get find sessions to respond on a per server basis rather then in a giant array when it's completed? The Squad guys have done it, and from my conversations with them last year it was a giant pain. Trying to get as much info as I can before I go down this rabbit hole.
From the look of it, it will be on a per OnlineSubSystem implementation as well.
There is no out of the box way to achieve this. Id imagine you would need to intercept the servers responses in the OSS individually in order to return them as they do so. No doubt it would be an pain to do. Havent looked into it myself but it is an feature ive been meaning to implement for my own use at some point.
Thanks @fossil spoke, seems to be the case. If I do end up doing it I'll probably do a write up about it
and @deep orbit that's more for #work-in-progress then here
Lol
@fossil spoke I searched online but couldn't find any potential info really so thought asking here
The problem was really with GameState replicating an array to clients. Since it does it once per second, the data was outdated by the time client had to use it. So I made a workaround by telling the server to send the data manually
how do I find in blueprints if something is owned by the clinet or server?
@tacit hazel ? As in during runtime or like looking at BPs?
You would know what is what if you designed it correctly.
Start with the Network Compendium that is pinned in this channel. You should be able to answer this question and more after it. If not, watch the UE4 Networking video tutorials
(2014)
Setting up networked games for multiplayer.
yah I dont see anything about ownership in there @wary willow I dopn't use bluueprints I just had to make a quick inventory with ui and I can't get a server RPC in C++ to function properly so I assume that my blueprint is owned by the clinet
hence the server rpc being dropped
I don't fully comprehend networking with blueprints or what the ownershup of UActorComponents or stuff manually spanwed in the editor
as I reread that it sounds hateful but its not
ok on further inspection I believe I see the problem, but I dont know how to resolve it as I don't use blueprints as I previously stated
the person playing is a client, who is calling a function made in the character blueprint, so it is a client that is owned by the server calling a server rpc so it is being dropped
so I am going to try to add it to my C++ player controller
Would anyone know why a worlds ActiveNetDrivers would be empty?
Game always seems to be opening port 0 instead of 7777 and it appears to be caused by the ActiveNetDrivers being empty. No idea why that is :/
@tacit hazel Clients can only call RPCs in ClientOwned Actors
So a ServerRPC in the possessed PlayerCharacter should not get dropped
hmm, radial damage event is not passing the origin properly
I have a dedicated server and i need data to be saved after server restart(this happens for each server because i want individual player data on each server), how would i do this?
@tall mirage SaveGame or External Site
When you state restart as in machine or just session?
ok
so ive been at this for a while
i have a system to find players last location before server shutdown and before player leaving
when the player joins i want to teleport him to his last location but i dont know which player to teleport there
i need a way of asigning a special user id
idk how to do user id's
the id would need to be saved locally to the player when he leaves
^I'm also looking for a good solution to that
Are you using any sort of online framework like Steam? Any of them should give you unique identifiers for each client
the player ID needs to be loaded every time the player joins and re-asigned to that player
also saved on server
idk how to do this
@tall mirage using a backend like GameSparks would be one way to handle this
Unless you are going to do the backend yourself
But it is as simple as having the unique player id assigned and then having it record the location data whenever you want. And then on load, you can set up a simple script that will TP the player to that exact location
how do i save the location data
i have variables contanining it
do i make a save game with the data?
yes.
@tall mirage you are looking for UniqueID instead of PlayerID, for onlinesubsystemNULL the id changes each time, for STEAM the UniqueID changes to the steamid64 of the players steam account.. idk bout other onlinesubsystems
ok
i know for sure for subNULL the id remains the same as long as the game stays running, so you can prototype disconnecting/reconnecting to a server without having to load a real subsystem like steam
ok
it took me 6 hours
but i figured out how
i constantly check players position and i am constantyly saving it
when player joins it looks at save file and sees all players last position
then it takes the last position and moves itself there
then continues saving
You save constantly?
That performance though
And your poor drive
lmfao
How many players you planning for?
hello, I am trying to get the online subsystem null working in c++, following what the engine does in UCreateSessionCallbackProxy et all. But once I create a session I cannot 'find' it. If anyone has any clue, here is the link to the question. I put in AnswerHub so as to not spam the channel here with a bunch of code:
https://answers.unrealengine.com/questions/670384/online-subsystem-null-cannot-find-sessions.html
please dont write it into a file at least constanty
every 30sec, or upon exit should be sufficient for any open world game to save locations
- you can tell server to save the location based on say, steam ID
along with progress saving
leaving the file to clients hands will expose it to cheating
it sounds like his multiplayer structure has no central authority, where any one of the four friends can host
so keeping such data locally may be a better idea, although im not sure filewrites is the best option
reminds me of civilization multiplayer resume's where you trust one of the four friends to keep their local saves legit
could prob do something cool with a cloudbackend owel
Im not sure, steam can probably save directly to cloud
but that could get complicated
or you could encrypt the save file
to prevent tampering
i just want to have my dedicated server to save not just variables
BUT THE WHOLE WORLD
along with player locations and inventory and such
i want the save on the dedicated server not each player
any help?
game saves? idk bout multiplayer. my first approach would be to have each individual important object saved in someway... example: Apple each time Apple is placed in the world Apple would query something... maybe it tells GameMode save Apple's location and other important stats to 'Fruit.txt' or sql fruits table? And you got your PlayerCharacter's constantly telling GameMode every 5-10 sec to save their location as well.......
So then eventually GameMode dumps its memory into a file or database and its time for everything to close. When server comes backup GameMode's StartPlay() reads fruits.txt/table players.txt/table into memory... maybe arrays?? Then GameMode simply just spawns all the fruit into the world... PlayerCharacter's that connect to the game will ask GameMode did i ever exist? from GameMode's PostLogin(PlayerController) maybe you can order the playercontroller to tell its first possesed PlayerCharacter to instantly teleport to last location
idk im just spouting nonsense but thats how i would start
@tall mirage hire someone to do this for you
@tall mirage I'm in the same boat as you right now. For each class type I want to save, I have a struct with the necessart data to recreate it. Then on save I build an array of the data for each type in a SaveGame object and the server saves it.
im going to upload to sql database
Just as a sort of cloud storage?
yep
i always cringe a little bit when i see someone directly connecting to a database, though if it's just a private dedicated server that might be ok
though you have to be concerned about possible sql injection attacks in your game server code
also if you're using mysql, libmysqlclient is licensed under the GPL and the UE4 EULA is not compatible with this license as it requires source code disclosure
because ip connect is a console command "open 127.0.0.1"
open level picks local map file
I'm generating a multiplayer map by spawning a grid of instanced tiles. The gamemode spawns the InstancedTiles actor, and the instanced tiles creates a random grid of instances that makes the map
How can I change this setup to allow all of the clients to have the same grid spawn? Is there a way to set a seed that each InstancedTiles actor would then use to create the map grid?
The instances are spawned based on a get random int in range node
Use gamestate to generate the seed into a var and pass it on post logon to generate it locally?
Should just read: open 127.0.0.1 if it's local machine. If it's lab you'll need the lab up such as 10.0.0.20
And be sure the session is even listening on the client with the session using the ?listen flag
Oh
Dedicated aerver
Are you running this on your own network or a provider of some kind?
anyone tried using FRootMotionSource_MoveToForce to do something like a knockback within CharacterMovementComponent? I get good results when the player initiates the root motion, but if a different player or the server initiates I'm getting tons of corrections when there's a bit of lag.
Well 127.0.0.1 is your computer so chances are it's using your session try by computer up address and put the port in
Default should be 7777
If you have the dedicated server running -log you should see the interaction on the window
if (mode == ENetMode::NM_Standalone
|| role >= ENetRole::ROLE_Authority)
{
MulticastApplyEffectCue(CueParams);
}
called from server
runs in remote client which in editor, but does no work on other client
when other client makes server it doesn't work on it, but works on client in editor
wtf
Anyone know if RepNotify replication works in replays?
Replicated information should be captured so it should
How's your progress been with replay @stoic maple
for future reference
testing multiplayer in single process if we have any kind of UObject singleton
is bad idea
it will not work
i just wasted 4h to learn it;d
Hey all, Trying a make a local top down multiplayer game with 6 players but can't get more than 4 to work....is there somewhere to increase the max number of players you can create
Are you doing this off of a template project? It might have a limit, but AFAIK there's no inherent engine limit present of 4 people
What functionality do you receive when trying to go over 4?
Thanks app -_-
just no ability to control anything over 4 even though player 5 and 6 are setup just like the other 4
I did start with the twin stick template
@brittle sinew thanks for the help by the way will check back in a bit on the road
Alright, I would go through a basic debugging procedure here
Make sure each pawn is getting a valid controller assigned to it. If so, check if the inputs are making it to the controller, and the same to the pawn. Etc.
You'll probably eventually find the breaking point, and even if you don't know how to solve it immediately, knowing exactly what is failing (or at least the symptoms) is a huge help
@brittle sinew @charred condor 4 is max
Definitely from BP. But you can change it from source. But good luck, probably will break it.
This limit is due to game consoles
On the template? Or is this in the engine and I'm just boneheaded lol?
Huh, I guess I never really tried over 4 now that I think about it, I just kinda assumed that didn't exist rofl
But it IS settable in CPP, however I don't think it is supported past 4
TBH. 4 is plenty for local.
And makes sense the max.
I just got 5 to work in PIE
From a project built off of Third Person Template
Number six was a blackscreen, not sure if it was a bad spawn location or just too many
Oh, now that I think of it, by 4 max do you only mean local?
I took that to mean all MP, didn't read carefully
And changed player #
you can sim quite a few players in PIE MP, but I think only 4 of them can be splitscreen
If you can even mix them
Yeah, which is what I think @crisp maple did
Quick question regarding RPCs- after looking at the official docs, it says that RPCs should be used for "unreliable gameplay events that are transient or cosmetic in nature. These could include events that do things such as play sounds, spawn particles, or do other temporary effects that are not crucial to the Actor functioning". They are still used for gameplay important things such as calculating bullet line traces and if damage was dealt etc. through custom events (run on server) right?
In an indeal world, I think the idea is that you'd find a way to use variable replication for this purpose.
In as much as possible.
But I wouldn't stress it too much.
I recall Smite having some crazy system of using variable replication to trigger things, don't recall enough about it.
There was an integer variable we'd increment that was replicated, I think, and we'd do that after a change to the contents of an array, and the array contained structs that contained all the possible information for any of the "flash" events.
We'd use RepNotify to then have the clients respond to that integer changing, look at the array, and process whatever.
That is my vague recollection of something done in UE3 for Smite almost 6 or 7 years ago.
That was also a clusterfuck, so I have no idea if it was a totally misguided over engineering effort someone made or a frustratingly necessary but super unfriendly optimization that was needed (redundant qualifications are redundant).
Ah thanks for the response!
NP. Sorry it's nothing more than theorizing, though.
Not the first time someone has brought up that particular line of the documentation.
My poor nooby brain can't understand how that works as for me right now I always imagine the server firing off events and replicating the results to the clients
Smite's code was a clusterfuck, because it was actually Global Agenda's code.
And because almost no one who worked on Global Agenda's code had a lick of game dev experience, but most were familiar with regular old software development, so a lot of stuff was torn out or bolted on based on familiarity, not best practices.
Ah sounds like a horrible combination haha!
That said, GA was also vaguely MMO-ish, so perhaps that "flash event" variable replication thing was a smart optimization for a higher player count system.
@wary willow Yeah, I just increased players and hit play
Really hard to say.
Would you say using RPCs for critical gameplay events in a faster pace setting (shooter with not as many players as an MMO) is ideal, or would it be more "correct" to find a way to do it with replicated properties instead?
Gotta keep learning I think, lots and lots to understand with networking ๐
Doing it in Blueprints for now to understand there, then tackling big boy C++ networking ๐
But, you could check out that 1v1 "shoot-out" game
whatever it's called
That was based in BP and has some stuff in there
I've seen on the forums that there is a bunch of not best practice stuff done there, but still definitely good to reference- just hard to know what is a good practice and not
I have things working as I'd like with custom events run on server, but just that line in the docs threw me off
I wouldn't be focusing on best practices right now
I would try to focus on fundamentals
Once you've gotten your head around RPCs, Replication, Ownership
And built a thing or two
Then you can start worrying about good practice/optimization
Yeah that makes complete sense
I do suggest reading everybit of the documentation
And obviously exi's network compedium
Yep filling up a large notebook the last few weeks
So in short- is a custom event run on server considered an RPC?
So run on server, multicast and run on client are the 3?
Those are on vars right?
So they trigger the event on changed
So for something like shooting a gun and having the server calculate where the bullet goes, I can't think of any other way to do it other than a custom event run on server
I would really focus on ownership, once you've nailed that, you are on a smooth sailing
I had some issues with that in the beginning
It seems simple enough, but you can get tricked rather easily.
Are you talking about physics ?
Or just line trace?
Awesome, I'll make sure to read everything I can
No just line trace
Simple line trace event
Yeah, that's almost always done on server
Don't know a case right now why it wouldn't be.
But I am sure there's got to be one
So doing it on an event is correct? Even though the docs say RPCs are more for cosmetic "other temporary effects that are not crucial to the Actor functioning"
Right, um, so, while I said read all the docs, reading it doesn't always make sense. Practice makes perfect.
Haha yeah I had thought I understood things at a basic level but that line really threw me off
the funny thing is
Most people will tell you that EVERY important gameplay event will be done using an RPC+reliable
Any cosmetic will be either local/unreplicated or replicated+unreliable
But, again, it's a case by case basis
Sometimes, "cosmetic" things like sound/particles are essential to gameplay experience in MP
Yeah from any of the examples or forum posts I've seen, any kind of gameplay event that needs to be done on the server to prevent cheating uses a reliable RPC. So I guess I'll ignore that line of the docs and continue doing things like that through events and then have the cosmetic sound / fx stuff be on an unreliable multicast event.
Thanks for helping clear that up- the line about RPCs not being used for critical gameplay events pretty much was the opposite of every example I'd previously seen
What's the best way to validate that an RPC received by the server has come from the client that owns the object (say a pawn) and not another client? Or does Unreal do something about this already?
i.e. if server receives "jump" command for a pawn, it shouldn't execute if it came from a client that doesn't own the pawn
unreal does that for you
It drops the RPC
Designating function replication across the network
'RPC invoked from a client'
can u not cast too and get the game mode in multiplayer? mine always fails
@sweet spire could you explain more? did you mean, GetWorld()->GetAuthGameMode()?
this always returns NULL if called from client side
Hmmm
i store a list of other servers
in my gamemode
best way to give that too the client?
stupid question
gamestate.
i think list of server should be put inside session search
ah i see
predefined servers by ID map u see
i really only need to replicate it once
or on updates
hmmm
wondering where would be the most efficient place too store it.
Actually
a better question would be
Is there away to call a ugh
Open level on the server
then make the client run it
Im asking best practices basically ^^
if the client connected to server, the server can call specific client via PlayerController->ClientTravel
inside ClientTravel would be the URL for the map
if you want everyone jumps, you should call GetWorld->ServerTravel
BP node?
yeah
soory mate i hve no idea if it's BP ๐
@hasty adder Sorry about the late response. I have it working, somewhat, but if I scrub backwards/forwards it does not replicate things correctly.
@sweet spire yes that one
shootergame is the best example IMHO
yes
UFUNCTION(BlueprintCallable, Category = "Networking")
void ClientTravelCN(Fstring url, enum ETravelType traveltype, bool bSeamless);
am i missing something?
@sweet spire should be enough
I am trying to implement a replay system, and I have a portion of code that uses RepNotify in order to execute a specific segment of code. The system works on a single play-through, but if I rewind or scrub, RepNotifys that have already played will not fire a second time.
I suspect this is by design, since Replicated Functions also do not play during demo record, since they're not bi-directional. I was under the assumption that I could still use this for RepNotify, though.
can u make functions u call server only or client only like u can with customs
Yeah i noticed there is no option so
My guess is
You call the RPC say server only
then have it call your function
If you use switch has authority on a function, how does that differ from a run on server custom RPC event? Just curious
Well switch authority only checks if you're on client or server
It doesn't do anything to actually call the function on the server
Certain functions like BeginPlay or Tick are run on both instances of the object, but if you just call a function locally (on client), even if you have a switch in there it'll still only be called on the client
The RPC is what does the actual handshake with the server and tells it to call the function on the server version of the object
So you'd just have switch has authority as a safeguard in case it's called elsewhere?
ey lethal heres a question for you, as i was unable to find the information on the network compodium
GameInstance? is that replicated? can everyone access this? whats the deal with it.
Sure, I would only use it in a situation where the function is called on both server and client and you only want the action to occur on one of them @inner iris
@sweet spire no, it's unique to each client and persists throughout their game's execution
Ok thanks for clarifying, much appreciated!
It's irrespective of what server they're connected (or not connected) to
Yep ๐ @inner iris
Gotcha
Last question for you then for good practice
Say i have a list of servers on a server(derp?) and my client triggers an event
to travel to another server
Should i just server side call the event fron the controller?
originally i was passing it to gamemode to get the correct server address from an array but
Isent that just a waste?
why not call it directly from the controller and have the control grab the list from gamemode
That sounds fine
You can't really call RPCs on the GameMode anyways; it only exists on the server
I wouldn't say that really, no
A server list probably doesn't fit residing on a controller
You can still access the GameMode from the controller, just not from the client version of it
Yeah, that would work fine
crap i need to grab server ip fron the game instance too
as that grabs the ip rom a serverphp call
(given "Client Travel CN" is a client RPC)
Was just checking for best practice
well i rpc the call server side only
and client travel cn
is just ClientTravel
exposed to bp
So it should get called server only right?
You should be fine; ClientTravelInternal is already a client RPC
(which is called by ClientTravel)
okay awesome
Was just checking
just trying to fine tune as i go along
save all them little bits of server cpu!
Just wondering, since you were talking about running 500 instances, I have doubts in that lol
Are you going to ram-cache the assets manually?
Your disks aren't going to be able to handle all of that IMO
no idea, i was just wanting too push it hard and see what bottle necks
i got m.2 drivers and some raid at my disposal
x2 2670's
800gb of ram
2.1 ram speed
just really wondering whats gonna be the bottle neck, so i thought id give it a wack
SATA or PCIe m.2s?
PCIE
Hmm, I still don't see a world where you'll get 500 instances running hahaha, maybe it's just me but that sounds like it'll bring anything to its knees easily
Guess the only real way to find out is try it though
more for fun and learning i guess u know?
i think ima get some better raid controllers
push for more speed
ugh i wish i had the ddr4 2.4 speed ram
but i only hve 2.1
the 2.4 is soooo expensive
But it be intresting too see how far u can go with dedicated servers
@hasty adder Main part of the replay system is this: https://wiki.unrealengine.com/Replay_System_Tutorial
Its the replication and such that is causing issues.
I didn't make the tutorial, just used it.
Wait what @sweet spire? Online it looks like that cpu runs ddr3
wait what
let me check my board
i might be thinking of wrong server
i have 5
1 sec
my bad
got my boards mixed up
mixed my dd60 ddr4 board up with ddr3 one
ye sorry i dont have 800gb of ddr4 lmao, its 600gb of ddr3
800gb of ddr3*
i have habbit of buying server stuff when big companies through it out, so i mix my crap up sometimes
@brittle sinew do u think il need to roll high amounts of ddr4?
800gb of RAM?!?
No idea really, everything is really expensive ATM
if u know where too look u can pick up 32gb sticks for 100$
example a z9pe is good cheap board for what it does
they can hold 256gb of ram
i think
i mean if i split my crappy ram equally
I have like
4 servers with dual xeon 2670's 230gb ish of ram each
and raid SSD's
but no m.2 to split around
There hard to pick up cheap
@brittle sinew you there? apologise for bugging you
Yeah, what's up
Remember few days ago you taught me the difference between controller and player controller right
if i wanted to get the player controller owner of say a UI
i would cast to owning controller than get player controller right?
Why would you need to?
Widgets have a get owning player function that returns a PlayerController
im inside a widget, and im trying tocall a function on the player controller.
wait crap
UMG's are not on the server
@stoic maple oh I recall you having problems thought maybe you had modified what's happening there. I'm going to hafta make a project of my own and dig into that
What's are you trying to call?
I don't see the issue here
The cast is unnecessary, the function already returns a PC
Just because the widget exists on the client only doesn't mean you can't use it to call RPCs on other replicated objects
ita asking for a target
So you want player to tell the server to travel
Which is the PlayerController you got from the getter
If it's your custom BP, you need to cast it
gotcha
i tried this before but was getting failed for the object type
i tried get owner and get player controller
If the server travels the clients will follow
i only want a client to travel.
How do you spawn the widget?
via a temp actor since its only for that level, it hands the owner to the player controller
I would check if the PC you're getting out of the getter is valid at all
It could be null
The controller game mode settings is set correct
ah okay
i think it fixed
im not getting failed cast anymore
Hi im wondering about, if the clients character/controller stays valid after it lost connection, or it automatically invalidates it after a period of time? or i should handle the dropping of the timed out characters?
Hey guys, a question about OnPostLogin on GameMode; when spawning an actor and immediately possesing it, calling a PlayerController RPC using the possesed pawn doesn't work. The PC's 'GetControlledPawn' function is invalid. I tried playing around with some delays which returns random results (sometimes it works, sometimes it doesn't; the higher the player count, the more random it gets). Why isn't a simple SpawnActor->Posses on the server side not working; there must be a better approach to this?
Replication of variables and actors has no guarantee of orderโI'm pretty sure you can just use a function on the PlayerController to see when it possesses a new pawn
Yep, try OnRep_Pawn
Oh interesting
let me check
doesn't seem to be available in blueprint? there must be an equivalent
Hmm, not sure then, I don't really see anything else that is exposed or implementable in BP
yeah, google isn't helping me much either; kind of a bummer this
so what's basically happening is, the CreateActor node creates the actor on the server (which hasn't been notified to the clients yet). The posses gets called, but seeing as the actor isn't on any of the clients yet it doesn't possess anything. When the Actor finally reaches the clients due to replication, the possess already failed and t he client's PlayerController didn't posses anything.
Not quite, no
The possess only occurs on the server, and the effects of that possess will eventually propagate to the client
ahh okay
Nothing about possession is failing here.
OnRep should be possible in BP
It's just that the RPC occurs before the pawn is synced to the client
ahh like so, yeah that makes sense
@severe widget not when it's already defined in C++
alright, that furthers my understanding a bit; thank you
You have to add that in C++ but you can call a BPImplementable
Yeah, that might be necessary
shudders
interestingly enough though, the RPC is now only called on Client PlayerControllers; ignoring the Server's PlayerController alltogether
yeah I don't like doing this :p
The issue with using delays in MP is you have no guarantee the replication will happen in 5 seconds
Sure, 99% of the time it will
But when it doesn't, things will break
Yeah, but still the issue I'm having right now is weird nonetheless
I'll probably delegate the OnRep_Possess from C++ to BP as PlaceholderName mentioned as the 'proper' solution
VorkuKeren 
The 'RunOnOwningClient' should also run on the Server's PlayerController right? (When the first player also hosts the game/acts as the server)
It's weird the RPC then doesn't fire when introducing a delay on the server
@brittle sinew shh is k
Even weirder, when running it on 4 players; it only calls the PC RPC on a single client.
As if the newPlayer pointer of OnPostLogin used to call the RPC is always the latest player after the delay (not sure how UE handles that behind the scenes)
Oh, you pointed out the problem ๐
Events on the event graph aren't instanced; the nodes that are present are the same nodes called each time the event runs
That's really it? hmm, interesting; thought BP would've managed most pointer shinenagens like this
And the other issues with using delays presents itself
When you retrigger a delay, the old one isn't called anymore
interesting
so if I want to get something like this working, I'd have to store the actual pointers in an array and later loop over them
yeah, delays are getting more horrible by the minute
ooooh
You lose subsequent calls to the delay node, and then it looks for the value of the wire, which is the latter one
it's actually not the pointer thing, it's the delay that gets re-triggered
yeahh
that makes sense
man :p
the C++ PlayerController as parent is definitely the way to go
Thanks guys, I really need to get used to some of these little UE tidbits
This helps a lot ๐
Would anyone know why the ActiveNetDrivers Array in Engine.h would be empty?
In my default engine.ini i've written
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
As per every every bit of online documentation I can find, including shooter game
prob not intentionally there to go along with their "engine for everything" philosophy. where if you need online subsystems you would just add them as you go
Anyone know why I can't call a respawn widget again after its been called once before
@ripe cypress rephrase please
Like a regular UMG widget?
That you use to respawn items?
i have an actor thats far far away in another galaxy, so obviously its not in network relevancy range. the actor has no netowner because if it did then the netowner would be the designated pawn its gameplay relevant to and if that pawn dies so does the object... so it cant have a netowner. this actor being so far away but referenced by the pawn as a variable `faractor* thing;' to be accessed fails to work on any sort of clientside operation since the actor is too far to be network relevant. everything works fine if the actor is in net relevancy range however...
my question is, how do i get actors to be network relevant if they are referenced in a replicated variable in a different actor, but they are too far away from clients to be replicated?
or
is it possible to have an actor's networkOwner's death not cause itself to be removed from game?
what the possess thing, i hafta read whats being attempted here
why are you using this postlogin to possess a pawn mate? @JoeyDeVries#3168 whats the problem and goal here?
because it looks like you could use a override on default pawn class in gameinstance(?) instead to choose different pawn when a player joins
gamestate
@twin juniper have you tried bAlwaysRelevant flag?
What exactly do these functions like AddAdmin, KickUser, BanUser do
is there a list of admins? a list of banned users?
that can be accessed/modified
Could I modify it to load from a .ini config file
instead of doing this
it looks like its loading from just memory
.-.
@Inphidel I usually ike to have a lot of control over things, including creating a player's pawn in this instance. I could probably do it by the default pawn as well (which I assume would then automatically be possessed by each client?), but I'd still have to do the OnRep_Possess which barely makes a difference for my case.
@hasty adder
Yell depends on your needs so you are trying to change the pawn before its possessed? Or after? And what's being changed. It will auto possess but there are ways around this like a dummie default pawn like spec
I'm trying to do some init logic on a pawn after its created/possessed, but there's no way in blueprint to get an event for when a pawn is possesed. So doing it right away will fail as getting the controlled pawn is null at that time (using a delay could work, but that's super hacky). There is a C++ delegate called OnRep_Possess on PlayerControlled that I can use for that exact purpose. So I'll have to re-delegate that to blueprint, and then use that delegate to fix it.
In the pawn itself there is a override for possessed
there is?
Yup
that would be great then, what's it called?
Possess I think it's in the list of overrides which younger to mouse over the events? Or functions area and you should see overrides
alright, let me boot up Unreal and check
hmm can't find it
I am on version 4.14 if that matters
Oh no, my bad; it's the player controller
Pawn would be fine as well actually
let me check
Yup it feeds over the controllwr posessing
Oh
you're right
For pawn there is a Possessed event
That would work just as fine
even if I do need PC specific functionality, I can always call it from 'getOwner'
oeh awesome
Let me try and work something out, see fi it works as I'd expect ๐
Alright, I think it works
it does seem like it's getting called twice; maybe UE automatically posseses any pawn that's created if PC is still without any pawn?
no, nevermind; that doesn't seem to be the case
Think it's just client and server runs itL
Hmm, I'd expect this to work
with the RPC being a simple 'print display name of possessed pawn'
@brittle sinew https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AGameSession/index.html
What exactly do these functions like AddAdmin, KickUser, BanUser do
is there a list of admins? a list of banned users?
that can be accessed/modified
Could I modify it to load from a .ini config file
instead of doing this
it looks like its loading from just memory
but it prints nothing, indicating it didn't properly possess it
it's also still printing twice per pawn, with the server check
@twin juniper no idea, maybe check the source before cold tagging? :p
I use it for a bunch of things tho I'm not sure what controller it sends class wise so I use the pin to cast to my controller class to get info playerstate
yeah, I'll do some further experiments and see how far I can work something in my main project ๐ thanks!
Yups
@brittle sinew What does A do inside B? Anyway that you could C your way out of it?
Ugh, I can't get it to work; I have no idea why this doesn't work:
With the print function:
It simply prints out empty strings for both the client and server, which doesn't make sense. The Get Controlled Pawn thus returns an empty pawn, as if it didn't possess at all o.O
The output:
Well, the RPC gets called (twice though), so the cast did succeed and it must be valid right?
Like I said yesterday, you have no guarantees in the order of replication
Just because the possessed event occurs on the server doesn't mean the client has the actor replicated yet
Controller isn't replicated , are you trying to get the llayer name or what?
oh, that would explain the situation, but isn't that weird? You'd expect when something succesfully posseses it actually has something to possess right?
And the possessed event fires right before the controlled pawn is set
hmm that would explain it
InPawn->PossessedBy(this);
SetPawn(InPawn);
but, that unfortunately does mean the possessed event wouldn't be useful in my case ๐ฆ
Within AController::Possess ^
Yeah I delay .5 on my casts
Ahh yeah, but then we're back where we started
If I override the OnRep_Notify, that would have right order, right?
As in that does ensure me the actor is replicated as well? Or same storY?
Yes, that is fired when the pawn is replicated to the client
Much cleaner way to handle it. But why you trying to avoid a split second delay?
because it can't give me any guarentees
The problem with delays is you don't know it's a split second
if a client is lagging far behind, it would completely miss the call
^
it'll probably work, and I'll consider it as a backup if all else fails, but if possible I'll still try to do it as accurate as possible ;p
If someone's laggin hard playing the wrong game ๐ kek
Do you have some document @brittle sinew about all the different exectuion orders of UE's (network) functions? The documentation doesn't seem to mention these things that often
Not really, I just look at the source most of the time
Get the most direct and correct answer out there ๐
ahh yeah
yeah exactly :p
I'm in the process of starting to learn to use Unreal's C++ side; I tried to do my current project in Blueprint only, but I keep hitting limitations; next project will definitely be as much C++ as I can afford (with blueprint where it makes sense)
I spawn my players in a fake spec class and the have a menu load to pick a tick works spiffy
Teams
Yeah ๐
I got an example of it on foruns
4.14 tho I think or 15
Had to stop work on it, limited time my game is more important! ๐
Oh wrong link
sweet
I'm off for tonight, thanks for all the help again guys, much appreciated ๐
No proba
instancedstaticmeshes
have to be one of the least documented classess in ue4
and a lot of the functionality isnt even exposed to bps
GetInstanceCount() does not even correlate to the index of the instances
its not 0 = 0, 1 = 1 in the array, its something else
because if u try to loop through the instacnes and remove them by count, it just doesnt work
how can I run dedicated server with console log ?
@eternal anchor add -LOG
thanks
it might need to be lower case
afaik case is ignored with arguments/console commands
yeah its literally impossible to loop through instancedstaticmeshes
and remove instances
or get all instances and their IDs and assign something to them
the functionality jsut does not exist
@slim holly it is when u are trying to rpeplicate the instances on a per instance basis and make sure that players who login later do not see the instances
in single player, yeah its completely simple
Hi I have a question about replication, authority, etc. Say I have a multiplayer setup and a key is bound to the pawn toggling a flashlight on/off. I'm not sure which way is bet to go about it.
Approach 1:
- client playercontroller sends an rpc to server: toggle light.
- server playercontroller executes the rpc, toggling a repnotify bool in its pawn.
- server pawn turns light on based off repnotify on bool.
- client pawn turns light on based off repnotify on bool.
This seems to work, but I notice a delay in the client between pressing the key and the light toggling.
On the server there is no delay.
Approach 2:
- client playercontroller sends an rpc to server: toggle light.
- server playercontroller executes the rpc, which executes a multicast rpc on its pawn.
- server pawn turns light on based off multicast rpcs.
- client pawn turns light on based off multicast rpcs.
No noticeable delay either on server or client.
But I think this has the disadvantage of being subject to net relevancy and update time.
For example if a pawn toggles their light and then another player joins the game,
the new player won't see the current flashlight state of the other player if it was toggled
before the new player joined.
So, is approach 1 the way to go? And if so, what about the noticeable delay on client?
another approach I guess could be to have the client controller itself turn its light on and then tell the server via rpc to change it's verson of the bool but with repnotify-no-owning-client. So that the client instigating the change sees it immediately but all other clients get the update "whenever". Though this means the client now has some sort of authority
Would anyone know why ServerTravel does not appear to be applying the ?listen parameter? The reuslt of which is my clients cannot join. OpenLevel works fine however and clients can join with no issues
@regal hazel Dedicated or no?
Nope, basically just following along similarly to shooter game, their ServerTravel appears to work fine, however mine does not (in the sense clients can't join)
They can see the session, just not join
Somewhere in ShooterGame it's correctly setting the url with the right port number, my game for what ever reason is not
Trying to track it down is a real pain haha
@regal hazel Maybe not in code, maybe in .ini settings ?
Thought the same thing but can't seem to find anything specific
Fixed it by calling GetWorld()->Listen() directly, just feels dodgy
So the ReturnToMainMenuHost and ClientReturnToMainMenu stuff isn't hooked up ootb. Anyone dealt with it? ShooterGame's implementation is pretty complex around that. Just want to destroy the session on clients when they return to the main menu. I guess I can just destroy it when the main menu map loads or before trying to join a new one.
yeah I looked at that, it seems convoluted
I also have another check going on in case the session wasn't destroyed (mostly due to unstable-ness in PIE) just before I create I check if it already exists and destroy it
if (Session->GetNamedSession(InSessionName))
{
Session->DestroySession(InSessionName);
}
DestroySession <- GameInstance::CleanupSessionOnReturnToMenu <- HandleReturnToMenu <- RequestFinishAndExitToMainMenu <- EndPlayingState <- EndCurrentState <- MaybeChangeState <- Tick()
tracked it back from their destroysession call
Yeah I completely reworked how all that stuff works but in regards to destroying the sessions CleanupSessionOnReturnToMenu does the job
where do you call CleanupSessionOnReturnToMenu tho?
If im the authority I end the game mode, if im a client I clean up some ui, call clean up sessions, then finally load the level
Ohh sorry didn't see your edit
I call a function that calls the above functionality (ExitAndReturnToMainMenu)
okay, I'm just looking for the ootb function to connect to
I guess it would be either on main menu load or disconnect
Ohh I see didn't realise those functions existed (just googled them lol)
Just been writing my exit flow explictly so I know what is going on
yeah the two I listed are ootb functions
yeah it's weird they are there but aren't actually called
How do you listen for client disconnect? I'm wanting to destroy the session on the client when the server turns off
Sorry for the delay @jolly siren! I catch it in HandleNetworkFailure in a custom GameEngineClass I have
When spawning a replicated actor, is there anywhere the server can process properties before the initial bunch is replicated to the client?
Hi, I am noticing that when travelling to a level after connecting to a server (->ClientTravel), the pawn or camera is wrong for about 1 sec. That is, my pawn is 3rd person with a spring arm so the camera always hovers above the player. But when the level starts, after joining the server, I first see what appears to be the expectator pawn or some pawn with 1st person view for 2nds. Any thoughts?
hi everyone
I'm attempting to implement an online subsystem
when I run the game in the editor however, it appears to fire Login on the identity service twice
which generates two sessions
it looks like this in the log:
it doesn't seem to call Shutdown on the first online subsystem
not sure where the best place to upload code is for this kind of thing
I can pastebin if that would assist in diagnosis, but I get the feeling this is something the engine is supposed to do, even though it results in two sessions in our online system
oh hmm
I think the engine expects me to allocate the unique net ID before returning from Login
even though the user ID isn't known until after the asynchronous login task finishes
thank you @regal hazel ๐
So here's a replication question. If I have non reolicated values such as impulse speed hard coded as variables. And rather then replicating the variable and setting it. If I replicate the bool that drives say max impulse -> select true thisvar or false other value will this be picked up by other actors since the logic overall should be replicated by the book?
Bool
So take character class has defaultskinred powerupskin. And bISPowerup_rep that will on rep use set skin material by select of that book true material is powerupskin false defaultskin - rather then replicate the skin in a rpc event just the bool changing will notify other players because of the bool change his skin should be that var in the class
If that makes sense
Google ustruct replicate ue4 :: found some code there otherwise I've no clue
oh i did
it says u can do it like rgular uproperties
but where do i put doreplifeitme
Wiki - "remember that only UPROPERTY variables of ustructs are considered for replication"
Hey guys! Is it possible to do a serverTravel using BP? I've tried to call "Console execute" with "ServerTravel Map", but no result..
It travels, but I do not know for sure, as you do need to check it in standalone game
Doesn't work in PIE
Doesn't sound like it works with steam either
Single process sounds like needs to be enabled
@drowsy notch yes, either use deferred spawning in C++ or expose parameters as "expose on spawn" in BP so you can have them available in the construction script
hey guys, I have a struct which has some values in it, but when i change them they are constantly being reset for some reason
USTRUCT(BlueprintType)
struct FFoliageInfo
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
int32 IndexID;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
int32 AmountOfResource;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
FString ResourceToGive;
void TakeResource(int32 AmountToRemove)
{
AmountOfResource -= AmountToRemove;
}
};
But when I call TakeResource() and then glog->log "AmountOfResource" its the same
is this because my struct is inside of a tmap
How are you accessing the struct from the map?
TMap<int32 MyFoliageKey, FFoliageInfo> MyFoliage;
FFoliageInfo Info = MyFoliage[hitTrace.Item];
then im trying to do Info.TakeResource(amounttoRemove);
im wondering if there is a step i need to be taking after chaning the struct, like do i need to push the changes or something?