#multiplayer
1 messages ยท Page 552 of 1
I guess that needs a follow up question: are blueprints synchronous / run-to-completion or can parts of a graph be scheduled to run later without you specifying an explicit delay? Do they write down guarantees someplace?
there is no multithreading in bp. You can use tasks which wait for a delegate to fire before continuning execution
but its all synchronous (even tho its called Async Task, it basically binds a delegate and waits for a callback
oh but the delegates are on an event queue
delegates are fired synchronous on the game thread
when you call a delegate, it runs everything bound to that delegate in the same frame
that part is reassuring ๐
why should I be suspicious of BP event ordering inside GameModeBase?
Shouldn't they all then be synchronous and deterministically ordered?
This is probably the wrong place to ask this, but I'm not entirely sure what the right place to ask this would be, and since I'm dealing with this issue on a standalone server, I figure this is as good a place as any: Is there a way to turn off the automatic reporting of script-warns to windows event logging? I'm running a playtest server that keeps getting knocked over by script-warns (which I know need to get fixed, but that's largely outside of my control right now) ballooning the Windows Event Log process' CPU usage.
And, yes, I suppose "Run your server on Linux" is, technically, a solution, but I was hoping for a config flag or something.
[I've managed to make it work] - edited
Hey, so I'm trying to make multiplayer work on a certain mechanic about player movement
So this "Simple Move to Location" is working fine as offline, but can't make it to work in multiplayer.
I've managed to make multiple things work like this
anyone know the best way to "replicate" all axis of rotation on a ACharacter, since pitch does not seem to replicate
Hey all I'm working on a kind of infinite runner with procedurally spawned floor tiles, because I want multiplayer of some sort what class do you think i should use for the floor spawning logic?
Does Game State make the most sense or should i try and make an actor work?
I had everything in gamemode which was of course silly because it doesn't exist on clients : )
This is probably the wrong place to ask this, but I'm not entirely sure what the right place to ask this would be, and since I'm dealing with this issue on a standalone server, I figure this is as good a place as any: Is there a way to turn off the automatic reporting of script-warns to windows event logging? I'm running a playtest server that keeps getting knocked over by script-warns (which I know need to get fixed, but that's largely outside of my control right now) ballooning the Windows Event Log process' CPU usage.
Ultimately just trying to suppress scriptwarnings to fix this for now.
log <LogCategory> Severity
can make it not log anything below severity
there is also a way to put that into defaultengine.ini as defaults
thanks @chrome bay that worked
is there a way to check if you're in a session? Like "bool bActiveSession" or something to that effect? I noticed when testing some 2 player listen server stuff, if the client is kicked in PIE and forcefully disconnected the Session doesn't get cleaned up unless you run a destroy session. In case the session isn't cleaned up properly I've added a destroy session to the main menu, but of course if there isn't one, it generates a warning. Not a huge deal, but if there is a way to verify if an active session exists that would be great.
whats the easiest way to bind the locally spawned actor with the server spawned version.
I spawn a bullet actor in local client instantly. then send a server rpc and spawn it on server as well.
I want to tell the UE hey in local client just map that NetGUI to the locally spawned actor instead of spawning another one.
its not that simple @rose egret
there is a way to force the engine to map server to client spawned actors
but you would have to prespawn a pool of bullets that way
and would also get some serious corrections when it replicates
oh didnt think of correction ๐ฆ seems its not much easy
for bullets i think you're better off in simulation mode
you could set the owner on the replicated bullet server side when spawning it, and have the replicated versions do nothing if the owner is locally controlled
its not just bullet. for my weapon pickup. I may need to spawn it locally as well.
we spawn our entire level client side
force the engine to treat all actors as if they were loaded from package
but we don't do that after BeginPlay
afterwards we go for normal replication
do you have any sample code ?
its basically spawning the level from the same seed
overriding IsNameStableForNetworking and IsFullNameStableForNetworking to return true for actor instances that are about to be spawned
setting BNetLoadOnClient and BNetStartupActor to true
and having them spawn with exact same matching names
also, not letting server replicate any of the actors while they are being spawned
by overriding IsNetRelevantFor
but we don't call BeginPlay on the world before every player fully finished spawning the level
and i don't think you'd be able to pull it off after BeginPlay was called
I try to spawn my character on custom team spawns and did it like this, but only the server spawns correctly the clients not. Does someone have an idea, why this doesn't work. This will be executed in the gamemode and the event is replicated to the server and is reliable
do you use findplayer start etc.?
i have sertan player starts for both teams an search for them
with get all actor of class
got it. The problem was i let all character at the begin of the game spawn, but the clients haven't joined then so the just stay were they are
Does anybody now something about OnlineSubsystemOculus? It looks like sessions found only with matchmaking pool. Advanced sessions always fail at find session node.
Is there any major change in 4.24.3? (compared to 4.20)
Does Oculus have anything else than matchmaking pools?
Been a while since i touched that
With the 4.20 version we have used AdvancedSessions plugin as default for both steam and oculus OSS, and it worked "out of the box".
Now it only 'kinda' works when i create a matchmaking session, then update the advancedsession extra settings
can I send arbitrary struct pointers SomeStructType* Struct through RPCs?
or will that just not replicate?
oh probably not gonna work ya
my session has a limit of max 4 players. When the lobby has 3 players in it and then 2 people join at the same time, due to long loading times both can join before the server updates the current players within it allowing 5 people in the lobby. Was thinking of kicking the last person that joins via PostLogin and a simple check of amount of people in the server but i cant find a way to kick people via blueprints ? Any solutions..
@untold swift But you used these Subsystems on their own, right?
You didn't mix them to have crossplatform, or?
@light fog Are you actively setting "MaxPlayers" to 4 in the launch options of that server?
Because UE4 has a system for this in place already
Hey!
I have a small issue, the variables inside a component don't replicate. I have checked that the component is set to replicate, its owner is set to replicate.
This event runs on the server.
Needs more info. How are you calling that function? What Actor are we talking about?
Noob question: suppose I'm trying to make an online checkers or ludo game, how can I allow a client to be able to move pieces? I thought making the tokens' movement function an RPC (Server, Reliable) would allow remote clients to be able to call it. I'm using a mouse button press and release event and projecting the cursor into the screen to move the tokens.
Red = parent
Black = child
The parent fires the event "On Turn On Object" on all it's childs on the server side.
All it's childs are the ones connected via a cable
The event that sets it to true is ran by the server, but its variables won't replicate to clients.
any tutorial for nameplates for a fps shooter?
I've managed to make them work using widget component in singleplayer but can't seem to get it working in multiplayer
if I do space=screen then everything works in multiplayer but the nickname doesn't dissapear when the player is behind something
@thin stratus Found the issue, a parent had set the component to not replicating inside a blueprint.
@thin stratus Yes ive set the max public connection to 4 yet it is still happening :/
its takes event OnPostLogin so long to fire from joining session being triggered (around 5/6 seconds ide say) this gap is too big!!
MaxPublicConnections is a Session term
I'm taking about the Options you pass into a server or into a listenServers OpenLevel node
isn't this a memory leak here in CallRepNotifies, third case?
say the property you made a notify function for is a string, this will copy the string to the temporary parms and then never destruct it
same issue with structs
Looks like FMemMark has some custom overrides for new, and frees the mem with Pop()
that will delete the FString object without calling the destructor, leaving the memory it allocated to hold the copy of the string data in limbo
Ahh I see what you mean. Hmm
guess I'll submit a PR to fix it
Hey, quick question i have this bool that keeps track of whether i was jogging before I started sprinting. Would I need to replicate this to both the server and client? My guess is yes
(This is done in the character movement component)
is there anyway to send Client RPC to a specified client other than owner ?
other that redirecting or by PC
thats what I am already doing
void ReloadStart()
{
for(APlayerController* pPC : allPlayers)
{
if(!this->IsNetOccluded(pPC))
pPC->ClientPawnReload(this);
}
}
The only way is how your doing it
Which is why a replicated property would be better
Also, nothing is culled on the Server - so the call to IsNetOccluded is superfluous
Oh nvm, just re-read. But yeah, a replicated property makes a lot more sense here
I have the same problem with replication. I can't have custom condition per connection.
and that's so weird.
Yeah you can't, there are specified conditions and that's all
But the point is that properties will only replicated to relevant actors automatically
So you don't need to control that
I need to stop sending of some redundant properties when characters are behind wall but still need some of them like fire event etc
the default conditions like SkipOwner, OwnerOnly, are not enogh for me ๐ฆ
You can't do that - but you don't want to anyway. Per-property checking of conditions for each connection would be far more expensive than just replicating it
A bool for example is a single bit, it's nothing
๐ค
Conditional replication works based on the type of connection, COND_Custom simply exists so your can turn replication of a property on or off inside PreReplicate(), but that's also for all connections.
Premature optimization and all that.
Plus I feel like that has the potential to create a lot more problems than it solves.
Keep it simple ๐
Property replication is cheap, trying to skip replication of a bool or something based on whether a player is behind a wall or not is fruitless
In the grand scheme of things it'll probably cost more than it'll save
It'll also cause a lot of sync problems. What happens when a player emerges from behind the wall etc?
Or late-joins - in the case of those RPC's above
I considered a big BBox for that. seems working
UT's character class has 49 replicated properties, plus all the base properties from the actor.
And they don't bother with it - and their target FPS was 120
what about replicating movement ?
is that sane to have 40 relevant characters for each connection ?
I already pause the replication when characters are far from the viewing client and and behind wall. plus some extra value when he the viewer has sniper ๐
Replication Graph is the quickest way to get benefits
If you have high player/object counts
Look at ShooterGame's code for handling weapons.
It's dated but still viable
yea I saw that.
another question. how you do implement client prediction for a fast peace FPS game. for realod, weapon switch, weapon pickup, ...
I am already using my homemade solution which seems buggy in some cases.
I am thinking about moving to GAS
๐ค
@meager spade is probably the best person to ask when it comes to GAS for shooter-y games.
strictly speaking you don't need complex prediction for weps IMO
you want certain things to feel responsive, ShooterGame has that. Reloading/shooting is mostly unaffected by lag for example.
ShooterGame is not the best approach but it works
Uses an unnecessary amount of RPC's
๐ค
i use a RPC per shot lol
all firing is done client side
including who the client hit
don't run animations on server nor do i do any re-winds
I am doing the exact same .
๐ค
I have some problems with Ack / Nack of the action local client performs.
@meager spade are you using GAS with your guns or just all your own systems?
for instance
player press reload.
reload task in done instantly on local client.
a server rpc is send to do send the action to server.
the local client do the reload but after it he cant do anything till verification.
I dont have things like revert rollback ,,
I dunno how to say it but when I get packetloss and lag I get into trouble
@dark edge GAS for the actual hit/targetdata/effects/cues
weapon logic (like firing state, firing modes) are all external to gas
like this is for my Weapon shot from my FireMode
my weapons also don't use direct bindings to ability system
basically, Controller tells pawn to fire its current weapon
๐ค
weapon goes to firing state if possible, if its ranged weapon, it activates the firemode
Automatic, single shot, burst, etc
this then calls FireSingleShot if its hitscan per shot, FireProjectile if its projectile or FireCartridge if its a shotgun
server side of the ability, sits there waiting for target data to come in
I am already using this damn system for weapon pickup.
https://paste.ofcode.org/pQr6QQW9YiU3ynfNUMa6cr
nvm I am gonna go play apex to refresh my mind
if I have a replicated property in my C++ PlayerState class, and I want an actor to be able to respond whenever that property changes, what's the best pattern?
do I just use ReplicatedUsing=OnRep_MyProp and trigger a multicast delegate inside OnRep_MyProp?
whenever I have a lot of multiplayer simulations running on my PC
like 3 clients
and a server
some RPCs dont get called unless they are marked as reliable
is this normal?
or is my network pipe getting too clogged?
@fathom dust whose that 'an actor' ? if its your pawn then
void OnRep_MyProp()
{
this->GetPawn<AMyPawn>()->OnRep_PlayerState_MyProp();
}
does anyone have a clue as to how one would create a local multiplayer character select? My idea is to have a widget that all 4 players use at once and preferably select with a cursor system (a la smash/ rivals of aether) to simplify navigation. I've seen tons of ue4 games such as street fighter v, dragon ball figherz, soul calibur 6, hell even yoshis crafted world use this system. so what are these devs doing that we somehow have not documented?
Coming from Unity, what would you say is the closest thing we can get to the Dot Net TcpClient in UE4?
Hey guys anyone know if UE changes some graphics/performance settings when you enable splitscreen? I have a problem where the landscape in splitscreen starts showing black artifacts i think it's shadows etc going mayham but not sure. Works fine when solo online/offline.
@shrewd tinsel this video explains everything: https://www.youtube.com/watch?v=94liD8Sfs8I&app=desktop&persist_app=1
Download links :
Scoreboard Project
https://drive.google.com/file/d/1v1Nq_QtRywzrEMQveAXnt2dpzJXNLXpN/view?usp=sharing
Server.Target below 4.15
https://drive.google.com/file/d/0B45Kp15-PhyOVXRORFVGbk90bUk/view?usp=sharing
Server Target 4.15 and above
https://drive.google...
@rose egret I've got a few different pedestals with buttons on them, I'm just making rock paper scissors to get my head around replication. One set of pedestals per player. If you choose a move, your pedestals all react by changing colour to show which one you've selected
I ended up just having a dynamic multicast delegate called MoveChanged that broadcasts in a setter for my PlayerState::Move, and the Pedestal actor sets up a server-only listener on the delegate in its owner's player state
It's hacky and I'm not a fan of it TBH but it means I don't need the state to know about actors in the scene
What am I doing wrong? I have:
BP_Furnace
It has a boolean: Enabled - RepNotify, replic.condition: none
It has an event, "PlayerWantsToToggleEnabled" - Run on Server, reliable
Another event, "ToggleEnabled" - Multicast, reliable
On the event of "PlayerWantsToToggleEnabled", boolean gets switched (validation logic comes here, I expect this to run on the server).
On the "OnRep_Enabled" event, the "ToggleEnabled" event is ran.
Event ToggleEnabled: Check if Enabled is true, and change mesh accordingly.
It only seems to work on the server. If I run the event on a client, all I see is the event "PlayerWantsToToggleEnabled" being fired on the client, and nothing else.
Basically what I want it to do is;
Client 0 -> server [I want to enable furnace XYZ]
Server -> [validates] -> enable furnace -> Tell clients 0, 1, 2, 3 that furnace XYZ is on
Client 2 -> server [I want to disable furnace XYZ]
Server -> [validates] -> disable furnace -> Tell clients 0, 1, 2, 3 that furnace XYZ is off
you doing a server rpc on it?
@inland hedge
if so then it will never work for clients
unless the client OWNS the furnace (ie, server has set the owner of that furnace to the player who wants to interact)
check this table here: https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html
@inland hedge Shared some code about using/interacting with a non-owned client side object and routing it to the server via the player controller.
At this point, its as if you are just calling a function on the server and you just what ever it is you wanted it to do on the server.
No predictions or fancy checks going on - that'd all be up to you.
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1781168-modular-interact-system
I'm trying to make a modular interact system that works like that:
1- All interactable Actors (like a door, a light switch, a shelf...) have a class component called InteractableActor;
2- When the player looks for the interactable actor and press "F" key, the InteractableActor...
Aaah, thanks @meager spade , I thought it might have something to do with "ownership"
I am using blueprints ๐ฆ no idea how to get those RPC to work.
I'm used to writing my own packets and protocol in my multiplayer games but this is the first time I'm trying UE4
Thus I'm stuck at using blueprints because I want to get to know the system
I don't know the API
That code looks clean, but I wouldn't know where to start writing it D:
my character spawns in as a spectator how do i fix it
gamemode settings?
Make sure game mode has a default character set, the map has a spawn point and delayed start on the game mode is disabled.
For starters ๐
hello everybody !, i am stuck on creating game session with cmd for 2 days now and i really need your help ๐ฅบ
do u know what does this means ? and how to fix it ?
@topaz kindle You need to delete some Fleets you have to many.
@fossil spoke is there a command to clear all fleets or i have to do it from web ?
Oh your trying to create a gamesession.
yes
Sorry i missread the error
Ok
So
A Fleet defines how many concurrent instances (GameSessions) can run at once.
You currently have set 4
You must have already requested 4 gamesessions before
And they havent closed yet, meaning your Fleet is full.
In the AWS GameLift frontend.
You can easily check where a Fleet is up to.
The maximum number of GameSessions cannot be greater than the Active Server count for a single instance..
You havent created a Fleet to use then.
i thought this command creates a fleet ! ๐ฎ
Thats not a command, thats a parameter to the create-game-session command
Its specifying which Fleet to create a GameSession on.
well, and when i create a fleet it is asking to select a build ! but the build drop down list is empty !
You have to upload a build of your Game Server to GameLift so that it can create instances of the Server.
Do you understand what GameLift is?
Have you read the AWS GameLift documentation?
It explains this process.
I recommend you read through this.
Learn about Amazon GameLift solutions for low-cost hosting of session-based, multiplayer games.
Use the Unreal Engine plugin with your game server project.
yes, but the tutorial i am following , he didn't upload a build or a create a fleet . he tested it locally i dunno how
and it worked with him with those commands and it printed Healthy !
GameLiftLocal is a waste of time. Its extremely limited in scope and can be difficult to setup correctly.
yes, that is what i was trying to do according to the tutorial
Its been a long time since ive had to deal with GameLiftLocal and i cant remember exactly how its meant to be setup.
well, thanks in advance. ill skip "GameLiftLocal" Step. i can't try on it anymore.
i opened those documentations few hours ago to check for what i have missed, but i didn't find a clue, thanks again โค๏ธ
Hey all, maybe someone here can help me out with this. I'm trying to do something very simple with Steam online sessions and ue4, that is just updating player names in a lobby. I successfully have people joining lobbies but only in the backend part. However, I'm getting a very weird issue. In the game mode class I've defined (and I know is active through some debugging) the Event OnPostLogin is not calling at all when another player joins the session. Am I doing something wrong?
game mode only runs on the host/server you don't need a switch has authority there.
That also looks like it's your main menu game mode. Is that the game mode that's active on your Lobby map?
@meager hedge
yes
also checking authority never hurts
despite the fact it shouldn't run on clients
It's an unnecessary calculation.
regardless, that doesn't tell me why onpostlogin is not running on the server when a player successfully joins
ugh
I used to have this issue
its back again
my client movement is choppy again
its choppy on the server and client
in addition to this, for some reason, some RPCs are not getting called
it seems like my network pipe is clogged
Doing reliable rpcs on tick?๐
I don't think so
But I am replicating each players control rotation
I'll have to run a network profiler and see whats going on
super easy to clog the network, one designer put the net priority 100.... by accident on one trash mob
result was that no short lifespan actors, like explosives, would replicate later in the game
Is there a normal way to trim down the amount of data that's replicated by a default UE4 class, e.g pawn? Deriving from Character, overriding PreRep() and not calling Super seems to be the easiest way to decide what should be replicated
not really, 4.25 started with the push model, but its largely incomplete
could you point me to where I can read more about that?
i don't know, still on 4.24 here so it was not relevant
iirc you can decide which variables replicate, but you can't decide if you want to push an actor to be evaluated for replication in the first place
which is the bigger issue, as the CPU time server can spend evaluating actos is capped
so you can end up with network congestion without having any bandwidth problems
which is where rep graph comes in
rep graph is just a more convenient way to handle relevancy
it helps, but its not a magic bullet
about 80% of my replicated actors replicate via fastarrays in custom network managers
and have the bReplicates false
which makes ~1800 Actors replicate via 16 Actor channels, and it improved the network performance a lot
since that upgrade our 8 player co-op game works just fine with 16
Interesting
Struct containing various parameters that can be passed to DOREPLIFETIME_WITH_PARAMS to control how variables are replicated.
DOREPLIFETIME_WITH_PARAMS?
cool ty
Would it make sense for me to remove replication limitation which allows server rps only from owned actors? The game is top down non-competitive coop and there are various objects which all players can interact with. Relaying all the interaction with these objects thru Pawn/PC seems messy.
Good reference for the issue is this thread https://forums.unrealengine.com/development-discussion/c-gameplay-programming/44230-rpc-client-server-not-working-owner-problem by @thin stratus
For gameplay programmers writing C++ code.
I am not sure how deeply is ownership integrated into replication. I imagine it as just removing some checks from the client and server code.
no, it would not
ownership allows for Server and Client RPCs
even if you could hack it to let Server RPCs through from non-owned Actors
what would the target of Client RPC be?
you don't really need an overabundance of relaying either
you essentially need an Interact() and AbortInteract() functions which are Server RPC
Maybe actor with same id on the server could be a target.
not having all your interaction go through the same pathway, that would be messy
I get to this issue because I would like to use character movement when character has no Controller. For example crouch the characters from the client.
Because of not having an owner, SetCrouch does not work.
And i also can not use custom RPC to call it on server as the actor does not have owner.
maybe I should do the RPC in PC?
if your controller is controlling several characters
at the same time
make a component for the ones that aren't possessed
server also knows that those characters aren't possessed and can crouch them itself
also, even if your controller is no possessing a particular character
as long as you call SetOwner on the Character server side with PC as Owner
it can RPC through them just fine
okay, thank you! I will probably try something with managing the ownership manually
if you have a bunch of characters that your players can control/possess freely
yes, up to 10
the round trip is going to be a problem
with frequent changing of ownership/possession
as you can't do anything before server executes its side of the code
and in theory, character can show as free to 2 or more clients, but they can all try to select/possess it before server marks the character as spoken for and that replicates
I see, in that case it would make more sense to do the server order RPC in PC and let it crouch chars
and not rely on ownership much
and there is nothing you can do about that problem above
in this particular scenario, no form of client prediction will help
In my option, it would make sense to be able to have RPCs even for non-owned actors. Not for all of them, maybe some specially marked ones. Unless security is top priority
they are net addressable, so just make a component on the PC to manage non-possessed characters
and put the logic there
avoids clutter
so basically that's the good old approach of stuffing everything to PC but with dividing it into components for better readability, correct?
not quite
your PC keeps track of hovered character
doing an example here, doesn't have to be exact
good example, as currently I have selection comp in PC which keeps track of selected chars :)
and there is multicast_CharSelected(char)
in the comp
so if you press C while you have a Character under mouse you do MyControlComponent->ServerCrouch(SelectedCharacter);
you can optionally handle possessed one in the PC
with prediction
and that one would react to C when there are no Characters under mouse, or it is the one under mouse
for example
yes, even in the Pawn
I remember Epic was working on some general prediction system
Is it still a thing?
it wears dipers
anyone here using advanced sessions?
If I disconnect from the game, I can't rejoin from the server browser
I assume cause it still thinks im in game?
Nobody is chosen, the player chooses to host, then other players can choose to join.
In Editor, the editor viewport is the host player.
But what if its not in the editor?
Is it the first player that launches the client.
Which is the host?
Hi Guys and Girls, can you help me with an issue with an animation in the network. I use on rep notify for this replicated variable and on rep notify I play a montage. This works On the server Only but the clients don't see it, and on Client To server the Owning Client and The Server Sees it. I would like to make it work on all. can this be done like this without replicating the animation? As I would like to avoid that.
If for example there are 3 players and 1 is the host, 1 plays the animation and sees only him. 2 plays the animation and only 2 and 1 sees the animation, the same for 3. But I need it all to see the animation.
Like the animation should play on all clients. Because the variable is replicated from the server to clients
this is in the character
I am not doing that in animation blueprint I play a montage
But I would like to avoid multicast an animation
this is why I work with a bool variable but it is like it is not multicasting.
You don't need a multicast if you have a replicated bool already
one sec
Should look like that.
The RepNotify function is where you would play the montage
It's not really ideal, though. The rolling should be integrated into the characters movement system
Yes there I play it trying now thank you
But i would like to integrate other animations as this one too ๐
so not ok that too
Extending character movement for multiplayer is mostly a C++ endeavour, unfortunately. That's the only way to do it 100% properly.
Then you just drive animations based on the movement state.
Not working ๐ฆ
The rolling this way works only on the server
It is like the replication does not go from the server. with rep notify
yoo, what's the best way to do nameplates in a multiplayer fps, I'm trying widget component with space=screen but this way the nick name doesn't dissappear when behind cover so should I try work it out or find a different way to do this?
Can anyone tell me how to create the dedicated Server AppID on the steamworks site to distribute your dedicated server build with?
Step 1 from the official documentation for how to do this doesn't work for me: https://partner.steamgames.com/doc/sdk/uploading/distributing_gs
Specifically there is no "Create new Tool" button from the instructions.... Step 1: under AppID landing page > "Associated Packages and DLC" > "Create new tool" button.
Or anyway to find this information. I've posted a question on the steamworks forums here: https://steamcommunity.com/groups/steamworks/discussions/17/2566438616665843199/
but I've done that before and it never gets me anywhere..
Hey guys, i don't understand how Force Net Update node (or cpp) work.
For me an actor tick X time per second (net update) and force net update allow you to force a tick, between two tick.
But when i use force net update, it's not happening on my testing,
How it work precisely ? thanks !
FNU just tells UE to replicate the data on the next frame. This allows you to reduce how often the server needs to check whether the actor needs its network state to be updated (NetUpdateTime)
FNU has no influence over tick.
thanks @foggy hinge, yeah, ofc i speak about NET tick (net update)
not tick of an actor (sorry for the confusion)
So, FNU should be only used (to work) on a client side, right ?
not on server.
Server side.
hum...
so i've got an issue.
Imagine i net update an actor every 10 seconds (for example, and it's on my test).
When i FNU on my server a variable, she is not replicated on the next frame, but on the next net update
and it's what i don't get.
Any dormancy rules set?
awake.
@nimble basin perhaps this will help: https://www.youtube.com/watch?v=kWicGy3_ig4&list=PLL0cLF8gjBpqCe9pzVWyW9Jk2lY4qioFr
Hey there DevSquad, today we've just released our FREE steam multiplayer fundamental course which will teach you how to use the steam API and the advanced sessions plugin to create the logic for your game to host, join and search for game instances within your project.
You ca...
Ah hm... relevancy rules? Replication graph rules?
no replication graphe, actor for the test is always relevant.
so but if you tell me FNU should update on the clients between two net update
then i probably do something bad, i will check back my code
thanks for the clarification james.
Well, it should update clients on the next net tick
@loud tangle Thanks, i checked it out.. it looks like basics for listen server setup stuff, but doesn't get into dedicated server, and setting up steamworks to distribute dedicated server. Thanks for the link anyway.
I've been going off of this guide which someone had shared and works pretty well so far, but i can't get the steamworks api to do anything with my dedicated server build.
Live tutorial on how to create an Unreal Engine 4 dedicated server with Steam!
If you have any questions, feel free to join my discord server at https://discord.gg/te8UvhZ
@nimble basin thx will check that too ๐
Hello! I am new to developing games, I was wondering if someone can help me get started with a game?
a multiplayer game* lol
oh, sorry!
if you have a specific question or need some tutorials then ask, but asking for others to help this is not the channel ๐
@dusk aurora first make a game plan see on the web how to do it. Then organize all your stuff and keep to the plan
then you'll know what to ask specificaly.
@polar lotus it seems your movement component is not replicated.
I tried that
it does nothing
it seems to only happen in a real session
lile
like
When I simulate in editor with 1 client, it does not do that
but If I package the game and run it on 2 real computers, the client does that
@loud tangle
Do you simulate lag in the editor?
This looks like you are modifying movement speed somewhere
And you aren't replicating that change properly
if I want to get all the player controllers currently connected to my game and assign actors to each of them, at what point should I do it?
Can't do it on beginplay, so is there an event which fires once all players have connected to the server?
There is OnSwapPlayerControllers
thanks I'll check it out
it acts the same way
Being the laggy way or the working way?
I have the same when I set the variable of speed and that is not replicated
So for example I have the default speed to walk then I set the speed to run on client
so the client runs but the server set's your position to the server's position as on server yo uwalk
@thin stratus laggy way
I have an older version of my game that doesn't do that I think
Are you modifying the MaxWalkSpeed of the MovementComponent?
not at all
What YLok wrote is usually what happens
So I would try to print the speed of the player, both MaxWalkSpeed and Length of the Velocity
And check if that is equal on both
I need to replicate my MovementComponent?
The older builds of my game worked fine without it
Hm, not sure you need to
I mean, theoretically you need to
But they offload the RPCs to the Character class
Either way, you have to make sure that you replicate movement speed changes
Also please do what I suggest for debugging
Otherwise I can't help you
MovementSpeed is not replicated by default, even if you replicate the component.
In BP only you have to make sure to use a RepNotify float and let the server set it, so you can then set the MovementSpeed with that variable in the OnRep
That said, this is still not the perfect solution, cause you will have small corrections at higher pings when starting and stopping to, e.g., sprint
Im going to try running an older version of my game that did not have this issue
and see what changed
... or you could print the speed values
And let us know what the result is
So we can further tell you what it could be
Okay, then I'm positive you'll figure it out alone (:
you're telling me MaxWalkSpeed would be the only thing causing this?
You Try to change it then test
@thin stratus
When i'm trying to change the gamemode when opening a new level, the gamemode wont change, did I input the wrong string?
Nevermind I forgot the _C at the end
its working now
how come i cant find any sessions? my ports are fowarded and stuff
i can only find on lan
do i specify what online subsystem i want to use just by adding the config lines to DefaultEngine.ini?
if i do not specify any online subsystem, will it find any sessions?
@exi plz halp
@jovial stream You can setup aliases for the GameModes under Maps and Modes in your project settings
steam should not need you to PortForward
Then you don't have to type the wholempath
do i need to specify any online subsystem to be able to find sessions?
Which one do you have specified atm?
@shrewd tinsel
Generally speaking, you need one that supports it. E.g. NULL doesn't, Steam does.
Steam however also needs you to actually sell the game on their platform, get an appid, etc etc. Not for testing but when finally releasing at least. You can also try to get Epics EOS to work, which should be free (?)
anyone have a good way to just sync an animation's play time?
i've got an object that just animates, and I want it to be in the same spot on all clients (it's a ferris wheel)
that's what I thought
but im not sure if the best place to put that is in the animbp
no, there is automatic clock sync
the replication via GameState?
can do better with just 10 lines of code
it syncs every 4 seconds or so
that one can get all over the place
hmm, ok
you just send an RPC with client timestamp, server sends the RPC with original client timestamp and its own timestamp back
difference between original and current client timestamp is roundtrip, estimate its half time to get to server, half time to get back
and you get a delta of server's world clock to client's
normally, it will be accurate to about 1/10th of the ping
GAS system sync montages
Not sure the code is bugfree
But they sync based on montage position
So you could check that
I have a quick question I just finished this tutorial on an interaction system and The client can't see any interactions https://www.tomlooman.com/tutorial-multiplayer-supported-usableactor-system-in-blueprint/comment-page-2/#comments
Should happen in the AbilitySystemComponent_Abilities.cpp in the OnRep_RepMontageInfo or something along that line
@gleaming vector
yeah, hmm
can the client interact @delicate zinc ?
Yes but only the sever seems to see the interaction
i'm trying to find the lightest weight way of doing this
so your states for actors after they are interacted with are not replicated (properly)
I think it is something to do with this
i originally added network clock sync for 1 purpose, now it has 10
@gleaming vector Can only suggest looking at their implementation
Idk how to tell the client that it just interacted
yeah
so its not a wasted effort
@delicate zinc Well that's okayish for the start. Your UsableActor has to properly replicate whatever the OnUsed is doing to it
How would I replicate it?
Additional step would be predicting the interaction for the local client. In addition to the serverrpc
Idk, that depends on whatever actor and its info
Replicated variables and rpcs :P like always
Currently I have a cube that changes color when interacted with it.
Sry I'm still decently new
Yeah that won't replicate
Make a color variable and set it to RepNotify
Set the color variable on the interact event
The replication of it will trigger rhe OnRep function that gets automatically created when you set the variable to OnRep. In that function you can then set the VectorParam on the Dynamic Material
If any of the above is unclear, please read my compendium, which is pinned to this channel
Okay, thank you I understood everything you have said. Thank you so much
Make sure the Actor is set to replicate and that this interact event calls on the server!
okay, thank you,
@thin stratus im not using any online subsystem, just opened ports and created a session. should work, shouldn't it?
@thin stratus hey thanks for writing the compendium!
yeah totally
@gleaming vector We actually ripped out the GAS implementation and it works well for syncing animations there will always be delay, ie client A will always see it slightly different from Client B. But does a slight slight difference really matter?
the bigger problem is that the animation drives a collision volume
that players stand on
yeah then that's going to be an issue, i mean unless you made the collisions volume client side only, with a RPC when they enter it?
it's a ferris wheel
so they walk on and start the ride?
ah
i mean that seems really hard to do considering you would need to know everyone's latency when the ferris wheel starts playing its anim
framerate drops?
because i have a non-standard situation where the client is being hosted in the cloud and the video streamed back to a browser
o_0
so, the client and the server are both in the AWS cloud
in the same data center too!
latency is like 1ms max
has anyone successfully created a local multiplayer character select? More specifically, a menu that allows for multiple people to operate at once without having to take turns. I've seen tons of ue4 games such as street fighter v, dragon ball figherz, soul calibur 6, hell even yoshis crafted world use this system. so what are these devs doing that we somehow have not documented?
why would you need to document that?
p1 controller controls p1 selector, p2 controller controls p2 selector
done? i guess? ๐
What would be a good approach for getting a random integer in range and replicating it? I want to randomly pick an integer so I can play a sword attack based on that integer, but I want everyone to see the same anim. So I need to replicate the integer. I just want to do it the most efficient way because this will be used/spammed over and over by players pressing the attack key.
use a seed
player has a unique randomstream set by the server
then you use that stream
Ahhh That sounds like a good idea. Let me try that out. Thanks ๐
hey UKaosSpectrum, nice to see you here ๐ thanks for the link you sent yesterday - but I'm a giant noob at C++ and think I'm doing this wrong
I didn't have a PlayerController.cpp so I made a new one
(used this link BTW) https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1781168-modular-interact-system
I'm trying to make a modular interact system that works like that:
1- All interactable Actors (like a door, a light switch, a shelf...) have a class component called InteractableActor;
2- When the player looks for the interactable actor and press "F" key, the InteractableActor...
I can compile the interface without a problem
now I'm adding the functions to my (empty) controller, and also had to add stuff to the header file (i guess?)
but I think I'm missing some crucial step, or the 2 pieces of example code you've written down aren't matching up
if (GetLocalRole() < ROLE_Authority)
{
IUseableInterface::Execute_ClientUse(UseTarget, this, UseType);
ServerUseActor(UseTarget, UseType);
}
else
{
IUseableInterface::Execute_ServerUse(UseTarget, this, UseType);
}
basically this part
its stating "Execute_ClientUse", "ServerUseActor" and "Execute_ServerUse" do not exist
but if I rename them to match the Interfaces' methods, the arguments no longer line up - what am I missing?
@meager spade shameless ping :3
show me your interface
I love it when you talk dirty to me
UINTERFACE(MinimalAPI)
class UUseableInterface : public UInterface
{
GENERATED_BODY()
UUseableInterface(FObjectInitializer const& ObjectInitializer)
{}
};
class SCAPEVALE_API IUseableInterface
{
GENERATED_IINTERFACE_BODY()
public:
UFUNCTION(Category = "Use", BlueprintNativeEvent, BlueprintCallable)
void Use(class AController* Controller, FName UseType);
UFUNCTION(Category = "Use", BlueprintNativeEvent, BlueprintCallable)
void ServerUse(class AController* Controller, FName UseType);
};
its the one you wrote on that forum topic
like, there's an actor param missing in this interface
or there's a useless actor param in the usage of the interface
but I feel like I might be missing some magical step because the misalignment seems to big for the two files to be supposed to be together ๐ค
allright ๐ take your time โค๏ธ
@inland hedge in umg, there can only be one focus cursor at a time on blueprints alone
Oh, i have no idea about UMG ๐ฆ sorry
I was thinking plain game development ๐ im very unexperienced with UE4
i mean ive been doing this for 2 years and i feel like i only have 2 weeks of experience
yeah the UE4 API is so extended, doesn't make it easier
at the same time there is probably some convoluted custom c++ involved with a system like the one im describing
well that would actually be really easy in plain old code
foreach (playernumber) {
playerAimingSpot[<playernumber>].x += player_input_right[<playernumber>] - player_input_left[<playernumber>];
playerAimingSpot[<playernumber>].y += player_input_down[<playernumber>] - player_input_up[<playernumber>];
}
in pseudocode
guys is anyone good at networking who can help me ? im having an issue with my game i put the open IP Adress here on Intro_umap i forwarded the ports for unreal my server connects but after 20 sec i get ConnectionTimeout. i tried to add [/Script/OnlineSubsystemUtils.IpNetDriver] ConnectionTimeout=300000.0 to my DefaultEngine.ini but it doesn't work on 4.25
anybody know how to convert modular character creation in singleplayer to something with multicast so that others players can see it? would prefer to see the blueprint coding so i can better understand how it works. i heard that i also need like a game instance if i switch levels so that the changes they selected in character creation carry over? really not a lot of information about this and i dont like the ue4 documentation on the subject, so id prefer someone to just send me something theyve done to get it working.
It depends. Are you going to have them choose the modular components after joining the multiplayer session or are they going to be chosen locally before joining?
well, the way this character creator im working off is seems to be set in local first off.
so i imagine it will just be converting it through multicast after its done
Okay, if you're going to do it locally, the first thing you need to do is save the configuration in the game instance. have you done that?
so it needs somesort of save system where the float values get represented...
and im not entirely sure how to represent that yet
it doesn't need a save system unless you plan to save the configuration between play sessions.
i think i need to set somesort of actor thing, where the guy is invisible at first,
but then it imports the changes that are associated with the user?
yeah. i plan to have that.
Well then first you need to look up how to create a save game and write that to file and load it.
so i need somesort of backend with a user database. and im pretty sure with enums i cant do that, i need to do something else for that.
create a save system. thats a good start.
You need to create a save game asset to hold all the variables you want to write to file.
and then when the game loads, it'll load the values you set in character creation?
login screen 'enter' username/ p.w > load level > load character variables > replace default character with the character creation material > spawn in level
something like that?
This is an example of the save game asset I use for the game settings. Things like antialiasing and texture detail are saved and set outside of normal variables in UE4.
ahh, so this is like an options menu
This runs on the game instance when the game starts.
to create a reference to that save game asset.
This is how they are saved when I want to close the game or force a manual save
You need to create a similar save game asset that will hold the configuration for your modular character.
is that save game asset something that comes with unreal already
or something i need to build
hmm okay. . .
oh you have a parentclass for svegame
with unreal already
?
or am i mistaken
Unreal comes with a savegame parent class built in
okay, thats really good
before you get into this, have you used UE4 before?
yes, but its extremely difficult
Okay well once you create the save game asset, you need to go in and add variables that you need. You'll need to decide what kind of variables you need to save the profile information.
i obviously know somethings but i have a great amount of blindspots because distance learning makes it too hard for me to ask questions to teachers
I'd start with that first. Once you have a working save system that reloads your saved configuration you can start to think about replicating that for multiplayer.
You can't simply just load the data. Once you load the savegame, all that is doing is restoring those variables. You'll need to create something on the character or somewhere else to take that data and apply it to a character in game and restore the actual character.
I have a multicast RPC that is not getting called all of the time on the client
Like
is it set reliable?
have you added a print after it to verify it's not being called on the client?
okay, ill work on that. for now, i think that is what i need. do you mind if i dm you in a couple of days or so once i get something working? i dont really have a lot of people who know a lot about multiplayer - especially for this thing.
I can try
Sure, I'm not an expert or anything, I dabble at most, but I'll help you if I can
so no one can help me ? my server is fine but i get connectiontimeout after 1 min
@shrewd tinsel No. UE4 doesn't magically show your Sessions to the world.
@fathom dust No biggie, glad it helps!
@thin stratus i see, so online subsystem is for when you don't want to type in server ip address to join, it allows to see all created sessions, right?
OnlineSubsystemNULL: Direct IP Connection, LAN Sessions (which is actually a Broadcast Message, asking whole LAN if they are hosting).
OnlineSubsystemXYZ: Depending on the support for it: Direct IP Connection, LAN Sessions (same Broadcast Message stuff), Online Sessions.
Depends on the Subsystem you want to use. Steam is usually used for PCs, but come with the whole 30% stuff of course.
right, thanks
are there any open source free simple basic online subsystems?
anyone used amazon online subsystem?
if i change something in the blueprints, do i have to rebuild server?
From CharacterMovementComponent documentation: it provides a framework to help developers create custom networked movement. ... IMHO it is all but framework... it is huge spaghetii class with everything stuffed together
Hey... if i open up a third person template and start a 2 player session the walking and running animations are replicated but in my project im replicating the same anim bp and using the same skeleton but the animations arent replicating... does anyone know how to fix this?
there is a basic git somewhere out there which contains the multiplayer level from the tutorials by using steam. and a few others. just try searching for those.
How can I assign a level/map to a specific player or group of players and put them in the same level while keeping another group in a different level/map? Because I want players to be able to que up together so I don't want to assign them a level at random
I have a lobby system where players can join a que and it will use matchmaking to grab the two players in que and move them out of the lobby and into a game level. But I'm not sure how to grab them and move them from lobby to a level together.
And have the level be instanced for them alone.
A lobby is normally a separate server or connection altogether
Players join the lobby, then the authority within that lobby connects to a game server.
Hello everyone :)
What is a suggested way to identify each player on the MainGameState for example to keep scores?
Can I simply keep it in a custom PlayerState and have clients retrieve the info from there for UI and other behaviour?
yep, player state is the place
๐ Always to the rescue Jambax ๐
A lobby is normally a separate server or connection altogether
@chrome bay Is it possible to keep it all in one server?
Not really, but you don't really want that anyway
Otherwise your game server will be chugging as it tries to manage all the lobbies as well regular game traffic.
i see. so I should make two separate servers. One as a lobby server and one as an in game server.
Then do I launch an instance of a game server for every new que?
Queueing is different to lobbies
Well once the queuing is done
I'm assuming a new instance of a game server
has to be spawned
or launched
no - but you need to have a connection to the game server to be in it's queue, so that it can tell you when to start joining.
We've done that in HLL with beacons
So the queueing portion is like the gateway from the lobbu connection to the game server connection?
There are a few parts to it:
- Game Server - the actual game you want to connect to and play
- Lobby Server - usually a player-hosted listen server, which other players can be invited to.
As for queuing, a player or a group of players finds a game server they want to connect to, then they request to join it - usually with a lightweight connection like a beacon. The game server then tells the players in the queue to join it once there is enough space available.
What about the initial connection when the player first logs in? What would you call that?
Because the way I want to do it is when players log in, they see a que button they can press. Then their MMR is used to determine who to put together.
And moves them to the game server.
Not sure what you mean. In the case of game servers, you either have dedicated servers which are running all the time, or players can host their own local servers which other players can then join.
Matchmaking is another beast entirely
has anyone dabbled in secondary servers or server migrations for listen servers? should this be implemented in a save file or game instance? there doesn't seem to be much else that persists to hold the data once the host disconnects :/
Okay let's scrap mmr from there, players are picked at random when they hit the que button.
And two are selected and moved into the game server.
That's not how it would work
They hit the button, then the player tries to find a server, then they try to join it
I see..
If you want matchmaking, then you need to also host permanent matchmaking servers so that they can join players who are looking for sessions together
And can a single game server host multiple game instances?
no
dedicated server = one instance of a running game
Ignore matchmaking, you don't need it unless you have half a million players
and it's monumentally complicated
that's up to you
Either players can host their own servers and other players can find and join them, or you can pay to host permanent dedicated servers online which players can find and join.
Or both
Yes my only concern with players as the listen server
Is it makes it easier to hack
The advantage of dedicated servers is that you can guarantee some degree of security, listen servers give no such garauntee
because whoever the listen server is is controlling the game in a sense
But the downside is, they cost a lot
yah..
honestly for indie games, just make a server browser
players will thank you for it
And add a "quick match" button for the lazy
How would that work?
Quick match is basically just "find the first empty server and try to join it"
In terms of the server browser it's just random people hosting servers right?
It can be anything
When a player hosts a game or a dedicated server is spooled up, it registers itself with the online platforms "master" servers - (so Steam master servers, for example)
Then you can use the steam SDK to get a list of all running games, and players can choose one to join
The ShooterGame template and Multiplayer Shootout template do exactly that.
(both on the Learn tab of the launcher)
Okay thank you for all the info :) I'll try and figure something out.
Check out the templates and read up on the engines' Online Subsystems and Sessions stuff.
It has everything you need
hello what's the best way to do nameplates in a multiplayer fps, I'm trying widget component with space=screen but this way the nick name doesn't dissappear when behind cover so should I try work it out or find a different way to do this?
yeah so I was thinking either do something for the nick to disappear when the player is behind cover or try space=world and both these ways seem to have their own problems so I was thinking which one is the best way
Hello guys, I have one more question :). I am doing very simple
SafeMoveUpdatedComponent(Adjusted, NewRot, false, Hit);
Velocity = (UpdatedComponent->GetComponentLocation() - OldLoc) / DeltaTime;
in character movement's PhysCustom(), however Velocity is not replicated to simulated clients. Is there anything specific I need to do to enable that?
Maybe update Velocity in SimulateMovement(), not sure about it
I was expecting it to work out of box as that is what PhysFlying() is doing
Hi all. I have a quick design question related to multiplayer. Can someone provide me some real world examples when I would use PlayerState vs. Pawn in terms of multiplayer?
I was reading through the network compendium but still not 100% sure
@grim lintel some implementations get blurry but I like to put something like health on the pawn but score on the player state.
Like if you were making Mario, your extra lives and stored items would be on player state. The Mario pawn would hold something like if it's big or the active item
@dark edge Thanks that helps a little. I think what confused me from the network compendium was the statement that we want something like Health on the Pawn (replicated) to prevent cheating. But then we have something like Score on the Player State, which I assume I would also want to have cheat protected. Or in other words: From that example I wasn't sure why I should treat health different than score. Same goes with the argument that those both would qualify for me to be something I want other players to know about.
But your example makes a bit more sense to me
@inland hedge I didn't supply the header declarations related to ServerUseActor() is all.
Gotta leave something for you to figure out ๐
Somebody on the forums linked me to this ue4 "network compendium" and it has been good reading so far. I just though I would post it in case it helps somebody else: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
I'm having some issues replicating shooting using RPCs.
This appears to work as intended when playing as the server, but as a client, i see the shots fired twice
with one not taking pitch into account
is there anything wrong with the blueprints ive shown here?
when I shoot as the client, all the server sees is the one without pitch
@spice snow is your projectile replicated?
it's hitscan
whereever it hits, it spawns an explosion (which has "replicates" checked) and does damage
That there's the problem. It's responding the explosion locally and also responding on the server, replicated, which means it'll spawn locally again
i see
Also, whatever is driving pitch is probably not being replicated correctly. Are you deriving your aim direction from anything other than control rotation?
You are already not predicting the shot so just do the shooting on the server.
i use the forward vector of the camera
i see
so i should just run it on server?
not multicast?
I mean, it's going to feel horrible with any amount of lag, but since you are not predicting your shots right now, it won't be any different.
If you want a really simple predicted shot technique, run the shot locally, then send the data about the shot to the server, which can multitask it out. A multicast, make sure that it isn't locally controlled before doing the shot, that'll keep the owning client from doing it again.
If you're not wanting to bother with that right now, just do the shot on the server, and replicate the particle effects etcetera.
alright, i have it running just on the server, but still pitch is not taken into account
which is strange since the shooting gets the forward vector of the camera
wait, maybe i can pin the start and end of the line trace to the event
@mystic pilot yeah thanks ๐ actually the Kaos guy explained to me yesterday, I didn't know about the generated Execute_ functions so I was kind of baffled at the mismatching signatures
alright, i think i finally got it working
i got the start and end of the line trace
and passed that through the server
now its all fully replicated
is this a good way of going about it?
hold up, its still happening twice haha
What's the proper way to shutdown a dedicated server after required GameHasEnded conditions are met? (e.g. all clients have disconnected)
Right now dedicated server processes keep running forever unless manually terminated, and I'm struggling to find an official way terminate them via code
@floral crow Well assuming you have a watchdog to observe the program exiting and release the server instance....
https://docs.unrealengine.com/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformMisc/RequestExitWithStatus/index.html
Requests application exit with a specified return code.
otherwise you keep burning resources without a process up
you'd want to return a meaningful code so you can log it/raise it
That's only really a guess though, if anybody else here has a better suggestion for terminating a dedi?
fallback would be that you run https://docs.unrealengine.com/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformProcess/CreateProc/index.html < this guy and invoke a shell script that waits an amount of time before consigning the server to the scalability gods.
If you just don't want the server up... like, why not reset the level? There's a function to do that, and if you're paying for a server to be up it may as well be ready to go
Creates a new process and its primary thread.
Hey guys, i got super lost in a rabbit hole and i have no idea where to start over.
Is it possible with NO plugins or dedicated server to run a server on 1 pc, and play the same game on that pc AND also have other people connect to you on your server?
It works with my OWN pc and people on my network but when i package the game and send it to friends its impossible for them to connect to me.
someone pls help
I have been looking and looking through so much stuff trying to figure this out, what DO i need? i can i get away with?
i just want to make a little game that other people can connect to, LAN is the only thing that ever worked. what am i missing?
Are your friends outside your LAN?
If so you'll need to have them connect to your external IP and do some port forwarding
Or use Steam for matchmaking & NAT punch.
Look up NAT punch through for more details
It's not an unreal thing
@swift cargo
@obsidian cargo
what port number should i be doing?
7777 is the default
But it's not usually a good idea to use port forwarding since your users won't do it
I want my character to walk, jog and run. I know I need to do this in a custom movement component, but should i also be decreasing stamina in the TickComponent() override
@swift cargo Port forwarding is just a shortcut to get your game working for you and your friend. You can choose whatever port you want. For final implementation you'll need NAT punch through.
@obsidian cargo
I tried pord forwarding, it didn't work for the situation with me and my friend.
Maybe it was a issue with the engine ini
I set it to use steam subsystem but didn't use any functions related to it.
Sorry I can't help with anything beyond general suggestions. I'm very new to Unreal myself.
Ye
Thanks tho
Any explanation on the implementation NAT punch through?
@obsidian cargo
@swift cargo The only way they will be able to connect is if they know your IP address btw, and they connect to that directly.
You won't be able to connect by just "finding" sessions, for that you will need an online service with a master server of some kind.
Hi everyone,
I'm trying to educate myself on constraints in terms of scaling complexity in the game world (on a single dedicated server).
I've followed a few discussions on the amount of replicated actors you can have on a single server. While researching this topic, the screenshotted thread came to my attention.
This raises a few questions for me that I'd be very grateful to have answered by someone more knowledgeable than me. That is:
I've always imagined the issue being centered around network bandwidth, whereas the thread says upgrading to a very beefy server solves part of the problem, whereas @bitter oriole (hope the ping is ok) mentioned that it's more an issue of it not being manageable on your client.
I can't put these things together, because it conflicts with my original interpretation of the constraints being concerned with bandwidth, that is causing you to typically be limited to say, 100 players. Is it maybe multiple things that are an issue? To which degree is what causing the limitations in this problem space?
The fastest way to see why it's also a problem for clients, is to put 100 basic characters into an empty map, and watch the FPS tank even in singleplayer
The issue is partly bandwidth yes, but the server and clients also need to be able to run and process all of that in the first place.
Then you add all your other gameplay systems on top, etc etc... you can see where it's going.
Hmm, that makes me think
Having hundreds of boids is performant with this tool
But, replication isn't enabled for this, because of the bandwidth concern
But boids are not even close to animated characters when it comes to complexity
No no, you're right. But would that mean that for simple things, it wouldn't be an issue bandwidth wise?
If your argument is "FPS will drop with many actors"
Well it would definitely still be an issue
As the FPS isn't the issue in this particular case
So it's multiple factors that constrain you
And it's very dependent on your game and what it does.
Would you be able to give some examples to demonstrate precisely that point?
I'm working on a survival game, if that helps
Well it's as I say, it's hard to give any specific example of what will and won't work because it's dependant on the rest of your game
The character movement system is very computationally expensive, as a starting point.
@potent cradle 100 players is very hard on network performance, server performance, and client performance. All these things need solving for 100 players (let alone more than that).
100 players is a massive challenge. Take it from someone working on exactly that.
Basically for 100 players you might enjoy rebuilding your own character class from the ground up, without the character movement component
Well, "enjoy", maybe not
"need to"
๐
Thanks guys ๐
I'm fine with trading players for AI, say, 50 players and n amount of AI. Can you say a few words about how the impact of AI actors that need to be replicated differs from players?
AI or player has the same cost really
Maybe more so, depends on the complexity of your AI.
It's not all bandwidth/network related - huge numbers of characters are just computationally expensive, that's the way it is
Let's assume I manage to reduce complexity in terms of computational performance, and it's mostly the network performance that I am worried about when I try to answer that question.
The only cost that is lowered through AI is your marketing budget, because 50 concurrent players is more than most indies ever see already.
100 players is still very heavy on the network yes
Whether AI or not
Also what Stranger said, 100 player indie is insane
Aim for 10
The reality of getting 100 concurrent players is next to nil
Sure, I mean, I'll let the AI scale to fill up player spots in the world. That's fine really.
Valid point though
yeah, multiplayer indie is a sad state of affairs this decade, unfortunately.
Not that we try to discourage anybody or anything...
yeah, multiplayer indie is a sad state of affairs this decade, unfortunately.
In what sense?
Did you look at average sales on Steam ?
^
Nope
Well, consider lucky to do 1000 sales (likely 10 concurrent users on launch day and then 2)
Fingers crossed ๐
Oh sure, I mean, chances are always low you pull it off
The journey has been wonderful though, even if it ends up crashing and burning
Yeah, working on games without needing them to sell is really nice
yeah just be sure to keep your goals in check ๐
sCoPe CrEeP
Some recent data on Steam
I do have some hope for the niche I'm in
@floral crow Well assuming you have a watchdog to observe the program exiting and release the server instance....
https://docs.unrealengine.com/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformMisc/RequestExitWithStatus/index.html
@severe widget Thanks! I'm gonna take a look into that
Requests application exit with a specified return code.
Multiplayer just makes everything at least 4x more work.
4x the fun too though ๐
I've been doing 100-player indie for three years now it's anything but ๐
Can I see your project?
It's taken a lot of people putting in lots of cash to get it where it is, I still think it's an outlier in itself.
The TLDR on Steam is that 20% of games have a semblance of a playerbase (handful of players), and about 5% have a real playerbase (about 50 players or more)
Yeah, the figures are very discouraging ๐
They're not really, you just need to do "play with friends" multiplayer as an indie without funding / large team
Release a couple of small games before going big, even getting to the finish line on a small game is a huge achievement.
You'd also be surprised how much stuff you forget about until it comes to that time too...
Haha ๐ It's definitely not my project BTW.. just one of a team
They're not really, you just need to do "play with friends" multiplayer as an indie without funding / large team
L4D style scope? Co-op type of thing. I think you made a point about listen-servers.
Ideally, 3/4 players cooperative on listen server
That you can still play alone, of course
It doesn't fit exactly for my game, but the point of keeping it smaller initially is making me think. Maybe I'll choose a lower agent count in my initial build. And gradually scale up.
What I'm saying is that, a game that fits 1 to 3 players cooperatively, has a 100% chance of being playable all the time. A 4v4 competitive game has a very large (>80%) chance of not being playable most of the time. Assuming you're an average Steam developer with a ~4 person team and some experience.
That's one way to solve it, another is to employ a lot of AI that can scale depending on the current player count
That's the strategy I'm thinking of taking
I'm fairly confident I can get at least 20 concurrent players, knowing the niche I'm in and my state at launch compared to other similar games.
Even if it dips to 1 though, it'll still be fun with an AI filled world. I don't want the fun of the design to be dependent on the amount of players in the world, to the degree that I can influence it.
It's a shame multiplayer isn't something you can easily tack-on after the fact
Yep
Maybe in another universe...
~~Far away...~~A long time ago...
Keeping the CCU up has a lot to do with momentum too these days, being able to quickly update and fix etc.
Yeah, especially for multiplayer games
sounds silly but you're almost better off releasing earlier rather than later now IMO
Yeah, I'm trying to nail down a solid first build and then build it out further from there
Smaller scope
Your team did the same?
Honestly, I'm pretty sure we were winging it in the early days. Our route was Kickstarter -> Publisher -> Early Access
I joined post-kickstarter, but they already had a sizeable community by then which helped.
But generally we done major updates every 6-8 weeks (give or take) for the first year
So just as people start getting bored, they get new toys to play with
That's a lovely cadence
I've seen games not release updates often enough, even if the build is buggy
That hurts a community
Yeah if you lose that momentum, your players start losing faith - but you gotta be bringing in the money to pay to keep it going, so it's catch 22
short-term achievable goals and all that
I was hoping the early access train would help fund further
Should we move this to #lounge ?
Yeah probably ๐
do i get a discount key for HLL? ๐
can try :D
Anyone know why steam would still allow lobby connections even though the lobby is locked?
Does anyone know how OnRep calls tie into the Actor LifeCycle when HotJoining?
I noticed OnRep's calling before BeginPlay. Is there an Event in Actors and Components that is guaranteed to call before OnReps?
(Also, OnRep's calling before BeginPlay is such bs...)
virtual void PreNetReceive();
/** Called right after receiving a bunch */
virtual void PostNetReceive();```
Looks like PostNetReceive() is before rep notifies too
(looking in FObjectReplicator::PostReceivedBunch())
there is also /** Called right after calling all OnRep notifies (called even when there are no notifies) */ virtual void PostRepNotifies() {} but this is after onreps are called
all the things
These seem to be for any OnRep though or?
This is specifically for HotJoining, where a Replicated Actor spawns on Clients and then causing OnReps
Cause these call Pre BeginPlay.
I mean, I can check if HasActorBegunPlay in the functions you mentioned, but I don't know how save it is to access things in those functions.
Yeah I don't think there's anything post-begin play
Haha, such a shit system
Can you initialize in PostInitializeComponents() or something?
too early
yeah I guess it depends what you need begin play for
Here is an example. Pawn's OnRep_Controller. Tells Components "Here is the Controller of the Client.".
BeginPlay hasn't called, so anything you try in there can not rely on BeginPlay
So you always have to build these weird pairs of "Do it on BeginPlay once, and make sure BeginPlay has begun in the OnRep."
Unless the match has started BeginPlay wouldn't be called either right?
I.e. they join something "InProgress"
Even if the match is running this happens
yeah
Yeah but it's shit. Because what if you retrieve something on BeginPlay, like a pointer and the OnRep needs to use that
Pointer would be invalid for the OnRep of a HotJoiner
Yeah... not always sure how secure that is, because I don't know how much before BeginPlay this call
Somewhere in the Actor creation code it must trigger the onreps
Trouble is you can't rely that much on Begin Play anyway
What if one actor reps before the other, etc.
But you always have that freaking issue or?
Yeah all the time ๐
Actors coming down in random orders etc.
No degree of determinism to it at all
for one specific actor in my game i have a timer that polls if the other actor has begun play or not, its silly, but they both need to have begun play :/
ComponentA inits in BeginPlay. ComponentB accesses ComponentA and needs it to be init, but ComponentB's BeginPlay called before As.
You would always need to setup some sort of Boolean + Delegate pair IsInitialized + OnInitialized()
and can't guarantee order
Well components are less of an issue because they all come at the same time
And they will execute begin play based on whatever order they were serialized into the actor IIRC
but for actors, no such garauntee between different ones
So yeah, lots of global events or callbacks to bind to if they rely on each other
Yeah even on the same actor, components might call in an order that is breaking it
Sad
Oh yeah totally
I also noticed OnRep_Controller doesn't always call
But it doesn't seem like a solvable problem for the most part.. you'd need endless layers of "begin play, post begin play, post post begin play" etc..
you can force it to always call
There is a chance that the PlayerController calls ClientRestart, and thus setting Pawn->Controller = this
Yeah but just the idea, that Epic codes something that is ot guaranteed to call
Because they somewhere set the controller by hand
Causing the client to say "Yo this is the same pointer, not gonna call OnRep"
The pawn/controller is thing has a lot of that tbh
;-;
To get around issues where one reps before the other
But yeah I've always had to code around race issues between whichever order actors decide to replicate in
It seems to be a more prominent issue in HLL just because of the sheer number of actors, I guess issues show up more often
i just do this cause i had the same issue ๐ DOREPLIFETIME_CONDITION_NOTIFY(UKaosAbilitySystemComponent, KaosAvatarActor, COND_None, REPNOTIFY_Always);
haha yeah that's handy too
Can you override the Controller rep condition notify in your own character?
Yeah there's an override macro IIRC
If there's no macro though you can do it directly, just by copying most of the macro code
SetPawn() at the controller-level is quite reliable
That works quite well for me
Needed an OnRep_Controller in the pawn/character
But I will set it to call always
Makes way more sense
player state hold a ref to the pawn now too. It's a three-way clusterbomb now ๐
I cri every tim
tbf my only remaining complaint with gameplay framework is the gamemode itself
so
many
functions
some of which seemingly do almost the same thing
Actors coming down in random orders etc.
@chrome bay @thin stratus I had a truly eye-opening experience when I realized GameState was replicating after other 30 or so in-game objects. I had to redo my entire initialization process after that moment
Yeah, some actors like that it's worth putting global events in place
I assumed something as Core as GameState would be guaranteed to replicate first. Newbie assumptions ๐
Nothing in multiplayer is certain ๐
been scorched many times
Feels good once you make it resilient to that stuff though
Does declaring the DOREPLIFTIME for controller again in the APawn child override the parent?
Cause I can't find a macro that overrides. Only one that overrides active, which is not what I want
Okay seems like the code is made to find already registered variables and set them up again
Ah one sec