#multiplayer

1 messages · Page 427 of 1

ocean dust
#

Alright, so I have to ask my players to run a different executable

#

Not impossible, but not friendly

swift topaz
#

no, only one person spins a dedicated server

ocean dust
#

Yes

swift topaz
#

all clients just use the regular client executable

ocean dust
#

I understand

#

But my "players" in general

#

when my game is released

#

and players want to play multiplayer

#

they have to jump through the hoops of getting the dedicated server executable, setting it up, and running that separately in addition to running the client game?

#

Again, not great, but doable

jade gazelle
#

Question regarding data persistence for items. I’m using an external DB to store player equipped items but am curious whether it makes more sense to store item attributes in the DB as well or just keep those static in the game executable, and just query a reference to the specific item name in the DB. Any thoughts?

ocean dust
#

Tough question, and a common one. I've found that Unreal's editor for DataAssets is a bit more focused and better at formatting data and working within the Unreal system than an external editor (such as a spreadsheet program or database editor)

#

In other words, I've opted to stick with editing stuff inside of Unreal as much as I can

radiant crag
#

@jade gazelle What kinda system are you using for that? Like CPP SQL calls to DB's and stuff or?

#

thinking about implementing a system similar but have never done it before

jade gazelle
#

@ocean dust I’m leaning towards what you are suggesting and keeping the attributes in UE and just referencing the specific item from the database. Seems like that might make more sense and be less strain on the DB as well

#

@radiant crag I’m using Postgres for the database.

#

Right now I’m prototyping with a BP plugin I found to do direct connection to the database but for shipping and moving forward I’m going to transition that to using HTTP connection to a PostREST server

glacial lotus
#

How to simulate lag when using dedicated server?

slim holly
#

run the same pk command on server

potent hazel
#

👌

glacial lotus
#

I'm going to try this first but thank you! Net PktLag = <ms>

zinc canyon
#

Normally, the RepNotify should be called on the client when the actor becomes relevant, right?

#

I just want to replicate actor visibility. The listen server application decides visibility, writes it to a repnotify bool, and in its OnRep SetActorHiddenInGame is caled.

#

However, visibiltiy is only initialized if I set the actor to be always relevant, otherwise it remains visible on the client even if its hidden on the server

umbral adder
#

@thin stratus can linux steam dedicated servers accept connection from windows steam client?

frank wagon
zinc canyon
frank wagon
#

I got question about quite basic stuff. I posted the screenshoot of the packaged game. Local/Remote role is the role called on the character. PC Local/Remote is the role called from character's controller class. How is it possible to have different roles? Why character from listen server got remote role autonomous proxy? When I test it in PIE or on dedicated server this divergence does not occur. Is it a bug?

solar halo
#

I'm having some issues with joining dedicated server via standalone with Steam enabled. The server log doesn't show any connection attempts and the client just says that the netdriver shutdown. Ideas?

umbral adder
#

show the logs @solar halo

solar halo
#

sec

thorny kelp
#

@solar halo we had exact same problem recently. It just stopped connecting to linux dedicated servers with steam enabled, even through it was working fine before

solar halo
#

What was your fix if any?

umbral adder
#

@thorny kelp can window's clients connect to linux dedicated servers ?

thorny kelp
#

@umbral adder yes

umbral adder
#

ok thx

#

what do u use?

#

ubuntu?

thorny kelp
#

@umbral adder we test both on ubuntu and centos

#

amazon gamelift servers are configured similarly to centos

#

@solar halo still figuring this out. Temporarily removed steam parameter from server startup. From game.exe -steam -lan to game.exe -lan

solar halo
#

I have another project that works 100% fine with connecting to dedicated servers, but this new project just doesn't.

thorny kelp
#

@solar halo probably steamid is invalid?

solar halo
#

@umbral adder

#

Yeah not sure.

#

It's really weird.

umbral adder
#

@thorny kelp u recommend gamelift or ec2 instance?

thorny kelp
#

@umbral adder we straightaway went for gamelift so I can't tell

umbral adder
#

ok

#

how much per month?

#

@thorny kelp

#

@solar halo server dint even start properly lol

solar halo
#

?

#

@umbral adder Care to explain? lol

umbral adder
#

i really dont know but the server started incorrectly

#

see logs carefully

#

try to rebuild again

solar halo
#

I have lol

umbral adder
#

lol

#

then i dont know

#

lol

solar halo
#

Yup

#

Literally can't test mp due to this now.

bitter oriole
#

@solar halo How's your client built ? Standalone or in editor ? Development / test or shipping ?

solar halo
#

Dev build as Client with Unreal Frontend.

#

So a packaged game.

#

Uploaded to Steam also.

bitter oriole
#

Is it started from Steam ?

thorny kelp
#

@solar halo try adding this to your DefaultEngine.ini

#
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver"

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
solar halo
#

Already in there an exact replica.

#

In Unreal Frontend I'm building WindowsServer and WindowsClient.

umbral adder
#

@bitter oriole for shipping ded server what are the extra steps we need?

#

only to put the dlls right?

bitter oriole
#

For shipping it just needs to be started through Steam, won't work otherwise

umbral adder
#

server

#

shipping server

bitter oriole
#

Talking about the client here

#

Haven't done servers

umbral adder
#

ok

solar halo
#

Oh also as a Development build.

#

The weird thing is it works fine when I add UWorks to the project.

#

I don't want to have it as a dependency so I'm reverting to the original Steam OSS.

#

There are no traces of UWorks in the project either.

#

@thorny kelp Gamelift any good and how was the implementation of it?

hasty adder
#

Dedicated servers I usesteam=false

thin stratus
#

Hm, do Splitscreen Players not go through the default "PlayerCanRestart" stuff of the gameMode?

#

I have delayed start enabled and create a splitscreen player in the test editor level, and that one seems to get a pawn

#

The main one properly spawns without pawn

#

Hm actually seems to be the other way round. The main one isn't calling it

#

🤔

#

Seems like the first player calls "PostLogin" while the MatchState isn't WaitingToStart yet

#

Sometimes I would really wish for these things to be consistent for all players etc.

unique thunder
#

Failed to produce item: GameServer.pdb

#

Can't seem to find anything online on this, anyone know why I don't have that file?

#

I've properly generated project files & compiled

fossil silo
#

Hey, does anyone know if its possible to use the new Steamworks SDK with UE without modifying the engine source? Or do i have to use the old version thats currently supported?

swift topaz
#

By default, if you're not using the engine source code, you won't be able to update the steamworks SDK and have to use the provided version.

fossil silo
#

gotcha, thank you @swift topaz

willow sparrow
#

A few weeks ago I've seen a comment on how someone implements replicated Animation Montages. He made a class and passes an instance of it with all necessary data like the Montage itself and what drives it to a Character that then plays the Montage. Is that common practice for replication? And does anyone have a tutorial up for it or some references? Unfortunately I can't find the comment again and I don't want to use the Animation Blueprint to handle some montages

haughty burrow
#

Does anyone know how to replicate a blueprint physics objects that doesn't require an event tick?

#

Or does anyone know if this'll clog the network? I basically need dozens of physics objects to push around

#

but they have special functionality like being damaged and broken, so they have to be a blueprint.

winged badger
#

you can try replicating the FTransform and Velocity only on frames when velocity changes

#

let the clients calculate in between frames on their own

#

and by "velocity changes" i mean acceleration/force changes

cobalt whale
#

Is there some guides how to implement VOIP? (better if it will be blueprints only)

ripe cypress
#

What's a good number for net frequency update in player character for a 8 player multiplayer game? Just need an idea for it an min net frequency update.

slim holly
#

@ripe cypress you can go all the way down 5Hz no problem, but that increases round trip times

#

most modern games use about 30hz

twin moat
#

Anybody know why a game would freeze for ~5 seconds when respawning a (local) multiplayer character?

ripe cypress
#

alot of code on begin play

twin moat
#

Thanks

twin vault
#

Is it possible to get the current session CSteamID??

#

wanna call ActivateGameOverlayInviteDialog but the LobbyID parameter doesnt seem to be exposed on the subsystem, and theres no function to get it on the steam api

thin stratus
#

SteamID is the FUniqueNetId that you can find on the PlayerState

#

@twin vault

twin vault
#

@thin stratus thats the player's ID right? i need the lobby id

thin stratus
#

Ah, my bad

#

You might want to check what the GameSession class offers you

twin juniper
#

Never mind, I found it out:

{
}```

We simply need to override this in our player controller. However, would this be transferred even considering we would be "client traveling" to the main menu? Actually, this function is not virtual so we can't override it. It's a useless function
brittle sinew
#

You should be able to override it; the _Implementation function should be marked as virtual automatically.

twin juniper
#

Would the PlayerController still have this data? Isn't the player controller destroyed upon level load? Therefore, when the player is kicked, they would get this information, and then it would be destroyed?

twin juniper
#

I know that when we call KickPlayer() it loads you to the "DefaultMap"

burnt blade
#

Ok so I'm having some roadblocks on replication graph

#

My main concern is how the lists are handed off to players, and how the spatialize actually creates the local nodes

#

I checked the shooter game example but that didn't really clear much up

#

And right now I'm using a MySQL servers to store player inventory, and wondering what the best way to organize this data is

#

I'm an SQL noob and it seems hacky so far

#

I'm using a map to map strings to in-game objects and rebuild inventories that way. It doesn't seem right

shell sinew
#

hello. I've been always from working with UE4 for a while, but I just read the updates and the Replication Graph sounds awesome. however, I stopped programming because running UE4 from source in order to be able to make a multiplayer game gave me a lot of headache, so I ended up stopping

my question is, for people that work with recent UE4 versions, can you make a multiplayer game without having to building from source? it felt really clunky from me, a non traditional programmer, so I gave it time

thank you!

twin vault
#

You only need to build from source if you gonna compile as Dedicated Server

#

if its a listen-server multiplayer you can do without it

#

@shell sinew

shell sinew
#

yeah, I wanted to use a dedicated server. I had a lot of transition weird bugs and I honestly didn't have the head for it by the time. thanks for the quick answer @twin vault

I'll probably check it out either way whenever I get a break
the Replication Graph may be even more polished by then

thank you :D

gleaming vector
#

i personally only ever build from source

#

for personal projects and professional ones

#

it's not htat big of a pain

jolly siren
#

Is this safe? Or am I going to run into issues where it gets destroyed on the server and never get torn off on the client?

void AFPSGunPickupZone::BeginPlay() {
    Super::BeginPlay(); 

    if (Role == ROLE_Authority) {
        // Destroy the gun pickup zones if pickups are disabled
        AFPSGameMode* GM = Cast<AFPSGameMode>(GetWorld()->GetAuthGameMode());
        if (GM && !GM->GameVariant.SpawnPickups) {
            TearOff();
            Destroy();
        }
    }
}

void AFPSGunPickupZone::TornOff() {
    Destroy();
}```
twin vault
#

are you destroying twice? is TearOff supposed to be the same as TornOff?

#

is TornOff a multicast to destroy on client?

#

Its not needed to destroy on client if the actor is replicated, one destroy on the server will destroy on the client too

#

@jolly siren

jolly siren
#

TornOff is a core engine function. It is called on the client

twin vault
#

oh mb

jolly siren
#

sorry meant to link actor one sec

twin vault
#

didnt know about those

jolly siren
#

But yeah normally calling Destroy would destroy them on the client too. The issue that I was running into with just Destroy is that since I'm doing it in BeginPlay it happens too early on the server, before the replication connection has been initiated between the server and clients. So it is destroying on the server only and remaining on the clients.

#

And I was trying to find a solution without adding a hacky delay

winged badger
#

careful @jolly siren , 4.20 added an ensure checking bHasBegunPlay

#

and doing stuff like Destroying an Actor from BeginPlay might result in "failed to route BeginPlay", along with a 30 second or so freeze that comes with failed ensure

jolly siren
#

where is that ensure?

#

I'm not even sure if how I have it is safe. I was wondering if the bTornOff could fail to replicate sometimes since I am calling Destroy serverside after setting it

winged badger
#

sometime after it runs the component's BeginPlay

mighty rover
#

anyone know if the Gamelift plugin for 4.16-4.18 works in 4.20? It's the latest version I can find on the AWS website

winged badger
#

you could run into it if you derive something from that class

#

then your derived class BeginPlay would call Super::BeginPlay, which would call Destroy, which for some reason sets bHasBegunPlay back to false

#

and... yeah, ensure

jolly siren
#

hmm okay, do you know an alternative to what I'm trying to do besides just delaying?

twin vault
#

are they placed on a map, you probably shouldnt spawn then at all

#

if they are, is there any function before it gets replicated so you can block their spawn maybe

jolly siren
#

yes, they are placed in the map

winged badger
#
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: bHasBegunPlay [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp] [Line: 1007]
#

found the log from that incident

#

as long as you can avoid that, it should be fine, and it was apparently an ActorComponent, not an Actor

jolly siren
#

ahh okay, that is good to know. But is it okay to call Destroy() on the server right after tearing off? Or could that cause it to not actually get torn off on the client (i.e. bTornOff replicated variable)

winged badger
#

you could probably hook into some PostReplicate stuff

#

but i don't know them off the top of my head

#

TearOff should have an immediate effect though, client doesn't need to be informed the Actor is TornOff iirc

jolly siren
#

well it does need to be informed since I'm calling Destroy clientside within TornOff()

winged badger
#

hmmm

#

i see only one call to TornOff()

#

DataChannel.cpp line 1740 (on 4.18)

#

should work tho

#

just not sure 😃

#

its likely to be gone before its evaluated for the next replication

#

at very least it will be bPendingKill

jolly siren
#

right, yeah testing it seems to work. I'm just worried about the rare cases where it doesn't. Since it seems like the actor could get completely destroyed server side before bTearOff is replicated

winged badger
#

depends on the NetUpdateFrequency and GC cycle though

#

it might cause an occasional crash

#

there might be alternatives, like tossing those on their own StreamingLevel and just not loading it unless its the right GM variant

jolly siren
#

I don't think it would cause a crash. I think it could possibly not get destroyed on the client sometimes.

#

Yeah, I've thought about that alternative too

winged badger
#

its the multithreaded curse

jolly siren
#

Also thought about just hiding them and forgetting about it

winged badger
#

eventually GC will ninja it at just the wrong time

#

you could probably use GameState to signal to clients it should be destroyed

#

just a theory, but if you have a replicated boolean for that and DOREPLIFETIME it before the Super call (provided that does not crash)

#

it should be replicated before MatchState, which signals BeginPlay should be called on clients

#

now there are at least 2 maybes with this approach

#

the variables do replicate in DOREPLIFETIME order tho

slender yarrow
#

does anyone have any recommendations for learning replication in blueprints. More specifically with the thought of an FPS in mind. There is almost no information anywhere on this. Youtube, answerhub, google. I understand the concept of replication somewhat, but when i start to apply it to projectiles and the characters moving and ADS and all that good stuff that comes with an FPS nothing works properly. The client can see random things, the sever can see random things the client is doing. I dont know 😕

fossil spoke
#

There is ALOT of information about replication. The issue is that its not an easy concept to completely wrap your head around from a beginners point of view.

#

Read Exi's compendium in the Pinned Messages of this channel.

#

Persist with it, you wont understand it overnight.

#

It is not a small subject to tackle and has broad reaching effects.

#

Download the Multiplayer sample projects and go through them, try and understand how their interactions work.

#

Do research. Play around.

#

You will get a better understanding over time.

slender yarrow
#

ok. guess its just not a direct, clear topic

tawny parcel
#

Anyone have any best practices tips for replicating a high volume of projectiles at fast speeds? This is a bit on the extreme side but I'm looking for as many performance improvements as I can. With dedicated server unchecked I get flawless movement doing this, with it check on the second cast it gets super choppy and projectiles start to jump.

tawny parcel
#

Also - I have nothing running in the construction script right now as I read that may impact performance. I set velocity of begin play and use the built in projectile movement component.

fluid flower
#

can you treat the whole thing as 1 effect/object?

tawny parcel
#

Nope, they are all individual projectiles that can have their own effects/explosions/other stuff. This effect is also just an example but I know in the future I will have multiple players and monsters casting abilities.

finite moat
#

@tawny parcel don't replicate the effect, just replicate the damage i think

finite moat
#

anyone know how to print log to dedicated server console using blueprint?

gleaming vector
#

printstring

finite moat
#

it doesn't work on dedicated server console

thin stratus
#

DevBuild or Shipping?

thin stratus
#

Yo, question about the build in Spectator System:

What's the proper way to swap a Player over to being spectator?

#

Previously I actively spawned a Spectator Pawn for them, but I assume UE4 has some build in dicision stuff that would do that already if I set some vars true or?

slim holly
#

I would assume the spectator pawn already exists by default

#

if you have set one in gamemode that is

#

other than that, I guess it's just a matter of possessing it

thin stratus
#

I'll see if "RestartPlayer" has a path of restarting the player as spectator

twin vault
#

Trying to look for reasons why i cant find sessions on a packaged game, but google only show results about the appid, which is not my case
using those

    settings:
    OnlineSessionSettings.bShouldAdvertise = true;
    OnlineSessionSettings.bIsDedicated = false;
    OnlineSessionSettings.bUsesStats = true;
    OnlineSessionSettings.bAllowInvites = true;
    OnlineSessionSettings.bAllowJoinInProgress = true;
    OnlineSessionSettings.bAllowJoinViaPresence = true;
    OnlineSessionSettings.bAllowJoinViaPresenceFriendsOnly = false;
    OnlineSessionSettings.bAntiCheatProtected = false;
    OnlineSessionSettings.bIsLANMatch = false;
    OnlineSessionSettings.bUsesPresence = true;
    OnlineSessionSettings.NumPublicConnections = 5;

    search:
    SessionSearch->bIsLanQuery = false;
    SessionSearch->MaxSearchResults = 20;
    SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);```
on a packaged game, different computers, different accounts..
#

Joining through presence and through invites works fine

#

only searching will return bWasSuccessful == true but 0 sessions on the array
Using steam

reef ingot
#

I would set bIsLANMatch to = true

#
SessionSettings.bUsesPresence = true;
SessionSettings.NumPublicConnections = 4;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bAllowJoinInProgress = true;
SessionSettings.bAllowJoinViaPresence = true;
SessionSettings.bAllowJoinViaPresenceFriendsOnly = true;

SessionInterface->CreateSession(0, SESSION_NAME, SessionSettings);```
thin stratus
#

Custom APPID?`

#

Might just be that 20 results is not enough and it gets flooded with 480 appID results of other games

twin vault
#

yes, custom appid

umbral adder
#

@thin stratus what do u want to spectate?

thin stratus
#

Ehm, the match? :D

umbral adder
#

ohh ok

#

spawn actor of class spectator pawn

#

possess

#

and then set view target with blend

#

@thin stratus makes sense?

thin stratus
#

I'm very well aware of how to do that. My question was more towards using UE4's build in system to already mark the player as a spectator.
Thanks for the help though

umbral adder
#

ohh ok

fleet raven
#

wtf

#

why does ULocalPlayer::GetNickname() return the computer name by default

#

this causes the computer names of all clients to appear in the server output log

#

for some reason FOnlineIdentityNull::GetUniquePlayerId is returning a string id that contains the computer name and FOnlineIdentityNull::GetPlayerNickname is extracting this string

#

wow all this only subsystem stuff is so amazingly convoluted

thin stratus
#

Yeah SubsystemNULL gives you the PC name by default

#

GetPlayerName of APlayerState does the same

umbral adder
frank wagon
#

Can I pass FTransform as reference in RPC? I'm calculating the values of quaternion and position locally on client and then I call RPC with signature void ()(FTransform&). Is there any doc where I can read about that? Couldn't find it myself. EDIT: I found that https://wiki.unrealengine.com/Replication#Function_Call_Replication here it says "// NOTE: all functions can have arguments, they will be replicated automatically over the network. // NOTE: UObject based classes (or derivatives) should be passed by pointer () and will correctly // address the version of that object on the receiving client or server (unless that object is not // replicated, in which case the pointer will be NULL)."

fleet raven
#

@thin stratus doesn't the one in player state only do that because of what localplayer returns, and passes to the server?

thin stratus
#

Could totally be. Not that into the whole process of playerName atm

fleet raven
#

it's appended to the join url as Name=Bla and then the game mode puts that in the player state

#

I think (?)

#

glad I don't have to use this overcomplicated online system stuff and can just make my own thing next to it with 50x less complexity

thin stratus
#

It's not that complex though. Iirc the Subsystem has the Change to override the name

#

e.g. steam returning the steam name

#

That's mostly all

#

The GameMode sets the name otherwise

fleet raven
#

oh

#

I wonder if things still work if I just disable the OnlineSubsystemNull module

#

ha it worked

#

now why does starting a listen server / dedicated server from the same game install use different config folders ..

thin stratus
#

Guess cause you want to have different settings for a Client (even if ListenServer)

fleet raven
#

why would I want different settings for a listen and dedicated server but the same settings for a client and listen server?

#

I think someone just didn't think when setting this up

fluid flower
#

anyone know why steam session don't update player count? Do I have to update session info for that manually or?

jolly siren
#

@fluid flower It only counts authenticated players. So you will want to setup the steam authentication stuff (see shootergame)

fluid flower
#

thanks, I'll check it out

fluid flower
#

can't find where they setup steam authentication, could you give me a pointer in which file to look perhaps?

fringe dove
#
  • **New: **Added support for the IP net driver to optionally use a separate thread to receive packets.
    • This is a useful optimization for platforms where the socket system calls can take a while.
    • Can be toggled by the console variable net.IpNetDriverUseReceiveThread.
    • Added a Shutdown function to FSocket that wraps the BSD shutdown function. This is used to cause the Wait() call on the receive thread to return when the net driver shuts down.
    • Added an IsSocketWaitSupported function in ISocketSubsystem so that callers can find out if the system supports the FSocket::Wait() call. If not, the net driver won't use a receive thread.
    • The BSD socket implementation of Wait() now interprets a negative timeout as no timeout.
  • New: Added support for IP connections to optionally make the socket send call on a background thread. It helps platforms where the socket send system calls can take a while. You can toggle it using net.IpConnectionUseSendTasks.
#

^-- anyone know which platforms they are referencing that are slow to do send/recv?

#

that also seems like with some modifications it could be nice for getting ping without game thread tick aliasing..

gleaming vector
#

switch and mobile

#

or websocket platforms

fringe dove
#

thanks.. thought it might be intel after the meltdown/spectre patches

jade gazelle
#

Hey everyone. Still sort of new to UE and had a question about blueprint optimization. I notice on a lot of tutorials and examples I research that people tend to spread out functionality over many, individual blueprints and then reference them together when needed later. For me personally I have been having a lot of success keeping things fairly centralized in the player controller & player state, but was wondering if there are performance reasons not to do this

winged badger
#

performance reasons yes - but your performance couple of weeks from now

#

got classes are inherently unmaintainable

#

and the more stuff you add, the worse it gets

jade gazelle
#

Kind of what I was worried about. Didn’t want to get to a point later on where I realize the whole thing needs to be reorganized and rebuilt

winged badger
#

it also makes you unable to reuse your existing code

#

without resorting to c/p

#

and after you start with that, there will be more and more occasions where you need to modify something, and forget to do it in one of the x spots

jade gazelle
#

So for like an inventory system for example, I should build that as a stand-alone BP rather than integrate into the controller or state?

winged badger
#

you can make it an ActorComponent

#

then you can just slap it onto other Actors as well

#

(both PC and PS are Actors)

jade gazelle
#

Ahhh that might be the way to do it

winged badger
#

i have 11 objects handling my 5 slot inventory

#

an ActorComponent that acts as a Manager for the entire system, each slot is also an ActorComponent, and each slot has an Object that manages the item activation

#

this is far from being the only good approach, its the one that works best for my game

jade gazelle
#

Interesting, I wouldn’t have thought about having a component for each slot

rare cloud
#

what about a component which replicate an array of UObject or struct (items)

#

and help to manipulate items

jade gazelle
#

Going to do some testing tonight with it. Need to find a way to parse the data pulled from the DB into inventory struct items

fluid flower
#

I'm using basic structs and it's working out great

jade gazelle
#

Do you have a texture 2d slot in the struct for icons? Or something similar like that?

solar flower
#

Is there something similar to the MessageBus that works in multiplayer?

#

If i just want to publish a message without an object reference

vapid mortar
#

how client can receive data from the server?

#

I want to connect to the server, and receives data from the server, what function should be use?

granite dome
#

Hello how i can create more users from server using new plugin Pixel Streaming ?

#

And it's only works on local network

potent hazel
#

are you hosting online @granite dome ?

#

I think you need to host your server online on a service like amazon AWS for it to be accessible worldwide

thin stratus
#

You need a Subsystem that has a MasterServer.

#

E.g. Steam.

#

Otherwise you can't find the session.

potent hazel
#

for pixel streaming ?

#

isnt that for multiplayer ?

thin stratus
#

Ah well my bad I guess

#

haha

potent hazel
#

:p

#

pixel streaming works a bit differently from what I understand

thin stratus
#

Question come up so often, I didn't read the Pixel Streaming part

#

Pixel Streaming was that WebService stuff

potent hazel
#

yeah

#

it sounds awesome

potent hazel
#

but looks hard to setup

thin stratus
#

Maybe that helps

potent hazel
#

gave it a go during the preview 4.21, and I had a fuckload of errors in the browser console

granite dome
#

@thin stratus Thanks

#

It's easy to setup but only for one PC

#

when you send to another PC on the local network you can also interact with the same actor :/

#

And yes i see that link but no more tutorials how to set up for more players on other sessions

potent hazel
#

isnt it supposed to create a new session ?

granite dome
#

i search only for local and only one session

#

and no more information how to create on a server or in the internet

potent hazel
#

its still in early access

#

give it some time

granite dome
#

Yea but it's nice) To make pixel stream

fleet raven
#

why does ACharacter::OnJumped run on the client controlling the character and the server, but not other clients?

#

shouldn't the movement replication be calling it there too

#

use case: want to play a jump sound from there

#

and also do some stuff in the anim bp

#

am I missing something here? attempting to send an unreliable rpc that the client has jumped would likely not be synchronized correctly

twin vault
#

looks like it should be in OnMovementModeChange instead of CheckJumpInput

#

you can override the movement mode changed and add your own OnJump i guess

#

or directly inside it

fleet raven
#

huh, how would I check for having jumped there

#

doesn't seem like there is a jump movement mode

twin vault
#

yeah only falling

proper olive
#

lmk if I should share elsewhere! ❤

thin stratus
#

@proper olive We sure do mind (: #old-rules please.

#

You could, if at all, share it in #lounge

proper olive
#

thanks!

rare cloud
#

Hi, I'm currently using IsNetRelevantFor to filtre which pawn can see other pawn but it's pretty slow

#

Is there a way to speed up it or an another approch ?

cedar finch
#

I have a general question that I've been struggling with. I'm making a multiplayer Wave based zombie game. My question is where is the correct place to put my variables such as: "WaveNumber", "WaveOver?", "NumOfZombiesPerRound", "MaxNumZombiesAlive" ?? Do I put them in Gamemode? Or since I'll be updating these variables throughout the game should I put them somewhere else like gamestate?

winged badger
#

clients have no need to know any of that

cedar finch
#

Ok so Gamemode will work then. Thanks. 😃

high current
#

So, I am making a game which heavily relies on objects accurately simulating physics across 2 or more clients

#

is that even possible?

tranquil basalt
#

Yes, you need to replicate the objects like everything else. This will affect your Servers Performance alot tho.

high current
#

Well its one or two objects at a time

#

I care that its accurate

#

what should be my way of doing the spawning

#

is it ok if the objects are spawned in the editor

#

or do I need to delete them on begin play and replace them with meshes spawned only on the server

high current
#

Nope, thats not either, everything is a big mess right now

#

I see people on UT, replicate movement on tick from server to client

#

but I am struggling to find out how to do that

#

i am BP btw, but I have a programmer guy in my team. We are doing the EpicGameJam

jagged garden
#

as long as you have an object that is set to replicate you should be able to see it on all the clients

#

and if its a character that you are trying to replicate make sure you have replicate movement checked and that the client is sending movement requests to the server

high current
#

I am replicating physics movement of various static meshes

#

right now I have just this, trying to replicate the transform value to clients

#

however it always comes up empty, no matter what condition I set it to

jagged garden
#

it looks like it should work in terms of replicating that variable

#

but if you're trying to replicate the position of the cube to the clients like that I wouldn't recommend that approach

high current
#

the transforms come up as 0 filled on clients

jagged garden
#

and the actor's replicates property is set to true correct

high current
#

on the server yes

jagged garden
#

hmm

high current
#

actually it wasnt

#

that seems to be the issue, its late lol, I assumed I had replicated server side already

#

but how you would go about it

#

the whole game is based around physics combat

#

so it has to be accurate across all clients

jagged garden
#

i did something similar to that before

#

let me look at it

#

ok

#

so heres the thing about physics

#

it can't entirely be replicated

#

as it would be way too intensive for the server to have to push all that data every frame

#

so what i would do is i would have the actor replicate movement and such but also do what you were doing before and have the server send the client the position it should be

#

to verify that the client physics simulation is accurate

high current
#

Cool,

#

and would I be able to somehow do the oposite

#

client to server

#

then the server checks and fixes stuff for other clients

#

as its a game jam after all, its just to deliver a fluid experience, with accurate-ish gameplay

jagged garden
#

it should do it automatically

#

the movement still gets replicated to the server

#

it just isnt always accurate

high current
#

if the client simulates physics

#

its a mess

jagged garden
#

right

#

itll eventually get out of sync

#

the reason is because the client isnt actually updating the movement

#

the server is just registering that the client's actor is hitting it

#

but when theres lag or desync then thats when the client's physics object gets messed up

#

so the only thing i can think of is to have movement that the client sends to the server and has verified, then that movement is applied to the server version of the physics actor, then that new transform and velocity is sent back to all clients

high current
#

y, I am way too sleepy to try trhat now, but its something I also had in mind, thanks for the help, might DM you if i run into trouble :p

#

Tomorrow that is

jagged garden
#

np man and feel free

high current
#

😃

#

Gnite

jagged garden
#

cya

potent prairie
#

a player can join the server just fine, but when he quits and then tries to rejoin, he isn't able to. Is there something I need to do when a player logs out so he can rejoin?

#

if player closes the game completely, he can rejoin. But can't if he quits back to main menu only instead of closing the game, then reopening it.

winged badger
#

call DestroySession most likely

real olive
#

Hey folks is there a way to have an array that's populated at runtime on both client and server, but also replicates changes? I want to avoid the initial replication of the whole array if I can.

thin stratus
#

Tricky, the Conditions for Replication might have a "Skip Init" or so, but nothing for skipping some operations runtime and some not.

#

You could probably do that in C++ I assume with adjusting the Conditions at Runtime too

real olive
#

I was thinking of doing that, but as soon as I flip it, it will send the whole array, right?

thin stratus
#

I wonder, why do you want to replicate it at all if you are able to fill it on the Client ?

real olive
#

to update changes. Eg. a chunk of voxels that can be destroyed

thin stratus
#

I would do this: Mark it as Init Only and do all other changes via RPCs.

#

That way, new Players get the updated Array when they join.

#

And RPCs only have to submit the change, not the whole array.

real olive
#

I have abilities that create many individual pieces of things, like a wall of fire, and each individual piece of the fire could have water applied so it becomes steam. The initial state would be all fire, then it would change at some point. The changes are predicted and the onrep kind of acts as a catch to make sure nothing goes wrong

#

if it has to be RPCs then I guess that's that, thanks 😃

thin stratus
#

It would be one of the only ways to keep the bandwidth low

#

There is probably better ways in general to handle such a system over network

#

If you work with seeds and only pass the seed, then your chunks could load and unload on the client without needing the server.

#

Cause they will be the same based on the seed.

real olive
#

right, but once you have modifications you would either need a replicated replay log or replicate the state directly

thin stratus
#

Yeah, directly is a problem for players becoming relevant later

#

Cause they wouldn't know about the change. That's what RepNotify is for after all

real olive
#

if using RPC, yeah. That was the nice bit about using OnRep for it

thin stratus
#

You could make an Array of a lightweight struct that represents the Replay Log

#

But that's also a lot of data

#

Hm

real olive
#

it's not that much data tbh - I usually have either 16 or 32 'blobs' of state

#

each one is USTRUCT(BlueprintType) struct FMRepElementInstance { GENERATED_USTRUCT_BODY() UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ElementInstance) EMElementState State; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ElementInstance) float Magnitude; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ElementInstance) FVector Location; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ElementInstance) float SpawnTime; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ElementInstance) int32 Faction; };

thin stratus
#

spawnTime and Location can change?

#

I assume Faction can change

real olive
#

yep, each time the element changes state the spawn time gets reset

#

Location can't, that's a good point

#

oh I had that in case my prediction was wrong, that's right

#

but that shouldn't happen anyway

high current
#

What is the easiest way to setup MP for playtesting, with 2 players, is there a way to do that trough editors, to somehow connect two editor PIE into one session?

steep jetty
#

Is there out of box support for two servers to communicate with each other? At most I would be looking to have a shared game state that would need to be replicated between them, but they would be responsible handling everything for their own clients.

jagged garden
#

@high current if you click the dropdown menu next to play there should be an option for number of players

high current
#

@jagged garden that one I know, but can people on other machines join that session

jagged garden
#

no

#

you'd need to have logic to create sessions

fleet sluice
#

Has anyone here been working with a custom OnlineSubsystem in 4.21?

high current
#

Well that was my question

#

so the only way then is to compile a dedi and connect to that with packaged game?

jagged garden
#

yeah if u want it to connect from another machine im pretty sure thats the case

#

although there may be another way

#

but idk

steep jetty
#

Should be able to do multiplayer testing end to end in PIE.

high current
#

will check it out for sure

#

ty

proper olive
#

anybody have some saved recommended reading for optimizing bandwidth? there's lots of stuff out there on optimizing graphics which I've taken advantage of, would really appreciate any links or suggested keywords to look up (I do know there's the new replication graph in 4.21 which I'm looking forward to, so that's cool)

jagged garden
#

im not sure how relevant this is to you specifically but this is a really good pdf

steep jetty
#

I'm going through that now. The only two general things that I could recommend are "don't send it" and "don't send it as frequently". Those are your two major optimizations.

#

Outside of that, it gets real specific, real fast about how to optimize packing data structures.

#

Reducing what's being replicated is always going to be your biggest win and that's what makes Replication Graph awesome.

high current
#

Also, how might I be able to replicate the player camera pitch

winter plover
#

So I am currently working on having chairs that player characters can sit themselves in, and in the pursuit of that I am trying to lerp their position and view into an appropiate place for the sitting animation. One problem that I need to deal with is the actor's movement being updated from the server when they are doing this at the same time, causing very noticable stutter. What is generally the best practise to deal with this? Is it possible to temporarily ignore incoming replication for movement? Do I snap the character in place serverside?

proper olive
#

@jagged garden yeah that's how I learned everything* lol but it's always good to do a refresher

jagged garden
#

yeah same

#

and dealing with bandwith isnt really a simple thing to deal with

proper olive
#

@winter plover for that exact effect I just snap clients and interp the server. Gotta have priorities

#

I figure it comes down to anything else - eliminate big hoggy variables wherever possible, but if there's any tools for analysis yet that would be cool, actually I know there is - I've used it before, but it's pretty complex

#

general reading is just nice to have when you're burnt out of work 😄

winter plover
#

@proper olive wait not the other way around?

#

since it's a cosmetic effect?

proper olive
#

I mean like if it's the server's character doing it

#

if it's a client I'll just bypass the whole blend

#

and stick em in front of the chair and then do the animation

winter plover
#

oh like a 3rd client?

#

who is not the local player?

proper olive
#

there's only 1 server and then all others are clients

#

in the traditional method

#

what am I doing, don't take advice from me 😄

winter plover
#

right what I mean is, that I want the interpolation ATLEAST for the local player

proper olive
#

yeah

winter plover
#

I would be okay with skipping the other ones

proper olive
#

on on their own screen

#

oh*

winter plover
#

yea

proper olive
#

sure just use "is locally controlled"

#

and run the interp there, then when it's finished, have the server update everyone's version of the character?

winter plover
#

oh right I might have been doing things a tad complicated

#

in my current version I start the animation and lerp at the same time

#

so they kinda glide into the chair

proper olive
#

that make sense, I mean nothing wrong with that

#

client movement always looks choppy when I'm the server, tho. I'm putting aside gameplay for now and gonna focus on network optimization. I know that as a client, everyone's animations look smooth, and that's sort of a UE4 problem in general, but I don't know if there's any workaround for it

#

like server seeing clients as choppy, clients seeing everyone as smooth

winter plover
#

actually yea I think just lerping the player locally BEFORE requesting to sit works alot nicer

#

thanks for the input, sometimes I tend to not see the forest behind the trees

proper olive
#

I'm here if not for the forest

#

whatever that means 😄

#

can anyone tell me if I package both distribution and debug builds, can they play together on the Spacewars ID? Cause my playtesters are like obsessed with hitting semicolon and messing things up when they don't know how it works, but i'd like to keep it on my own system if I wanna enable it

winged badger
#

i regularly host DebugGame version from VS with live one that is in sync

#

that way when i crash, i crash with the Debugger on

proper olive
#

ok that's good to know 😄

cedar finch
#

What is an easy way to do a game over when all 4 players die? Do I display a widget saying Game Over then destroy the session or is there a way to return them all to the lobby together?

thin stratus
#

You do what you want to do tbh

high current
#

Ok, for now I have 2 players, I am appying a dynamic material on one's mesh, and changing some params

thin stratus
#

@cedar finch You can send them back to the Lobby or display a gameover and let them disconnect.

#

All the same work in the end

high current
#

how do I get that to be visible

#

for the other player

#

multicast seems a no go, as well as running the script from game mode

thin stratus
#

Material changes aren't replicated. Means you have to replicate them yourself.

#

Since the Material is probably in your Character Class, you will want a RepNotify variable of that Param

#

And in the RepNotify function you modify the Material Param

#

@high current

cedar finch
#

@thin stratus Thanks lol I'll try sending them back to the lobby. I like games that do that. Some games just return everyone to the menu witch makes it a pain to have to re-setup the lobby and invite your friends back. I'm sure it's probably easier though to just end everyones session and open up the main menu.

high current
#

Cool, thanks, although that means no timeline 😦

thin stratus
#

Sending them back to a Lobby Level is just calling "ServerTravel LobbyLevel" again @cedar finch

#

@high current Why not?

high current
#

well repnotify is a function

#

and timelines dont work in functions

#

right

thin stratus
#

Sure, but what keeps you from calling a CustomEvent from within the Function?

high current
#

I swear that wasn't a thing in 4.15 😄

#

but yeah you are right

#

I spent too much time in UT editor

#

what exactly should my setup be

#

as it is still only showing on the initiating client

thin stratus
#

For the reveal, I assume a simple RepNotify boolean

#

Cause the whole thing only needs to know if it should reveal or not

#

You don't seem to use any other parameter

#

And you obviously need to let the Server change that variable

#

Not the initiating client alone

high current
#

And the reveal CE should be multicast

#

I guess

#

that seems to work

thin stratus
#

Wouldn't multicast

#

late joiners/players that get relevant later will not get the reveal even then

#

That's what the RepNotify is for

cedar finch
#

So I have a variable "Wave Number" inside my Gamemode. I get that variable inside my PlayerHud in order to display the current wave number on everyone's screen. Clients don't see it though. Do I have to pass the variable to Gamestate or something else in order for clients to get the variable since gamemode is server only?

rare cloud
#

@cedar finch you declare the variable inside your GameState yup

#

also you can set it on both with a setter function to make sure GameState variable is updated too

cedar finch
#

@rare cloud Ok thank you.

high current
#

When I am playing on a network, or even two instances of a standalone game, basically anything but 2 players in one editor instance, if its on a listen server, the second player rolls back quite frequently

#

if its on a dedi, both players roll back

#

during movement and physics interactions

thin stratus
#

Roll back?

#

You mean their location gets rest?

#

Are you modifying their MovementSpeed somewhere?

high current
#

I think I actually fixed it

#

every single component was set to be replicated

#

inside the character

#

but I actually don't need that, as when it comes to physics, my events are on the server, and clients don't simulate anything locally

tawny mason
#

Hey guys when i start a game with 2 players both seem to controll the same character and i cant figure out why

thin stratus
#

Without knowing more about your Code, we don't know either :P

low pond
#

Has anyone tried integrating gRPC into UE4? (Not to replace existing networking, but communicate with other meta game services)

tawny mason
#

@thin stratus Well really there isnt much to say, the controller is the base one and the character is kind of custom but not on the setup, so i would think it should work. Could it be that i have posses set on disable?

rare cloud
low pond
#

@rare cloud I saw that one, even added a issue to it to understand the currents status and it compared to another project

winter remnant
#

hi, how do I create a multyplayer game with a client - server system? Do you have a wiki to advise me, updated with the EU 4.20 engine?

limber plaza
#

Hey SirTheo

#

where are you starting? Have you learned about replication & rpcs?

#

Also are you doing blueprints or c++?

winter remnant
#

yes, but how can I divide the two systems? UE4 makes it possible to start the game in "dedicated server" mode. I want to create a client and a server that communicate.

limber plaza
#

Nice! yea. I can maybe help you a bit.

#

tho first, are you using c++ or are you using blueprints

winter remnant
#

I prefer to use blueprints, but in order to create a server it is necessary to create the code in C ++

limber plaza
#

Also, are you trying to get a server / client thing working in the ue4 IDE? Or ... are you wanting to build the server separately (aka a dedicated server build)

winter remnant
#

the second option, a separate server

limber plaza
#

nice.

#

Ok here's what you gotta do.

#
  1. add some c++ code to your project (pretty sure you still need to do this)
#

so that means, you want to create probably a c++ folder at the root of your assets, open that up, add some class. It can be of any type, and call it ...whatever you want

#

you will probably have to restart your project after that.

winter remnant
#

okay next?

limber plaza
#

next:

#
  1. Look in your project source, (are you using vscode? or nah) Try to find the <YourGameName>.target.cs file
winter remnant
#

yea

#

done

limber plaza
#

in that same directory you'll want to create a Target for your server:

#

Mine looks like this:

#

PlayerVsServer.Target.cs

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class PlayerVsServerTarget : TargetRules
{
    public PlayerVsServerTarget(TargetInfo Target) : base(Target)
    {
        Type = TargetType.Server;
        bUsesSteam = true;
        ExtraModuleNames.AddRange( new string[] { "PlayerVs" } );
    }
}
#

Keep in mind to replace PlayerVs with your game name,

winter remnant
#

wait

#

in <name game>.target.cs I have to overwrite the code, or create a new file and name it <namegame>Server.Target.cs

limber plaza
#

sorry, create a new file in same directory as <name game>.target.cs, called <name game>Server.Target.cs

#

Let's continue in private messages, I don't want to bum anyone out.

winter remnant
#

done

#

okay arrive

mighty rover
#

In 4.20, after creating a Server Target in my source, I build a Development Server and it outputs as <projectname>.exe in Binaries > Win64. Isn't this supposed to be <projectname>Server.exe? or does it not do that anymore?

limber plaza
#

hmmmm

#

The server will still be called Server.exe

#

but it needs some of the game files to launch the server...

#

Do you use the project launcher to build your server? or do you do it from vscode?

mighty rover
#

Visual Studio (version 2017 Enterprise) actually

limber plaza
#

Ah ok! I've started building a different way, want to try it?

mighty rover
#

sure

limber plaza
#

I'm using the "unreal frontend" or "project launcher" tab...

#

it actually saves me a ton of time...

#

I'm assuming youv'e got your server target correct, & you'

#

& you've got your dedicated game logic all ready.

#

Aka, starting sessions, starting a listen server when the game is launched in "dedicated" mode.

#

If not, this is still useful stuff.

mighty rover
#

not yet - I'm using a test project. My other project is ready to go, but I don't want to do anything until I get this process down lol

limber plaza
#

gotcha!

mighty rover
#

so just using a test project in the meantime

limber plaza
#

makes sense. I use git to make sure I don't make any big mistakes... anyway here's the project launcher flow:

#

open your uproj, go to "window > project launcher"

mighty rover
#

using perforce here, but still, don't want to cause issues cause I'm also upgrading the source code to GameLift (amazon servers) cause they don't support 4.20 and I'm not going back to 4.18.

limber plaza
#

(ouch!)

#

I use azure because I'm b8'nd from amazon.

#

Ok so let me know when you have your project launcher open

mighty rover
#

quick question - I want to make sure I'm using the correct launcher. Prior to yesterday, I only had the launcher version of unreal and then yesterday I downloaded the source version and after compiling engine source, I ran Local Windows Debugger to open launcher and then I created my project from there. I also have the project launcher installed from before though, so how do I open it making sure it's the correct launcher other than running from Visual Studio?

limber plaza
#

Ah yea. So if you're ever worried about which unreal engine your uproject is pointing to -

#

right click on your uproject, go to "Switch unreal engine version"

#

Then navigate to the source you want, be it the binary, or the source built.

#

Personally I use the sourcebuilt version, just incase.

mighty rover
#

ok loaded from my source built

limber plaza
#

After you do that, I think it's good practice to right click on your uproject and go to "Generate VSCode solution"

mighty rover
#

Just loaded the default Unreal Project Browser

limber plaza
#

Hmmmmm

#

well we dont' need the unreal project browser, just double click your uproj

mighty rover
#

<took everything over to private chat so we don't flood this one>

thin stratus
#

@tawny mason TBH, no idea without seeing the code. Generally Contorller and Character is a 1 to 1 relationship.
A Controller can't possess two pawns and a pawn can't be possessed by two controllers.
Possess even calls Unpossess. So if they are control the same character, then you are doing something odd in your code.

thin stratus
#

Soooooo

#

What is the "proper" way to swap a Player over into Spectator Mode?

#

UE4 has bOnlySpectator, which is basically for people that should never play.

#

But also bIsSpectator, which is never set to true anywhere

#

At least I couldn't find that.

#

It seems like the PlayerController has a State System

#

In which you can swap from Spectating to Playing

#

But that doesn't change the boolean of the PlayerState in BeginSpectatingState

#

It does set it to false though in the EndSpectatingState function

#

But that seems to also work with bOnlySpectators (which is kinda weird)

#

In PostLogin it seems to use this for "MustSpectate" when they are "onlySpectator"

#

So not sure if the bIsSpectator is even meant to be used for normal spectating players

#
int32 AGameModeBase::GetNumSpectators()
{
    int32 PlayerCount = 0;
    for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
    {
        APlayerController* PlayerActor = Iterator->Get();
        if (PlayerActor && PlayerActor->PlayerState && MustSpectate(PlayerActor))
        {
            PlayerCount++;
        }
    }
    return PlayerCount;
}
#

This is really strange. Why having bIsSpectator and bOnlySpectator where the comment for bOnlySpectator clearly states that this is only for players that should never be spawned and then only using the bOnlySpectator one for everything?

#
bool AGameModeBase::MustSpectate_Implementation(APlayerController* NewPlayerController) const
{
    if (!NewPlayerController || !NewPlayerController->PlayerState)
    {
        return false;
    }

    return NewPlayerController->PlayerState->bOnlySpectator;
}
#

Looking at it I would say the Spectator System was either never fully implemented and thought out.
Or I really don't get how these two booleans are supposed to be used.

#

And then there is bPlayerIsWaiting, which apparently has to be false for the player to really not spawn (even with bOnlySpectator being true) >.>

glacial hamlet
#

Looking at it I would say the Spectator System was either never fully implemented and thought out.
Or I really don't get how these two booleans are supposed to be used.

Yea, its a pain point to say the least.

#

Its sort of left to you to synchronize state between client and server. Then there is of course the Unfreeze function + timer which just changes state again. Always felt kind of dirty using the timer / unfreeze to drive such an important aspect of gameplay.

thin stratus
#

Problem is that I'm using UE4's system of Restarting the Player.

#

And that does also check for Spectators.

glacial hamlet
#

indeed

#

it "mostly" works for us, because we've had to add some extra RPCs to keep things together...

thin stratus
#

I would've assumed it works like this:

bOnlySpectator - Player is only a spectator, will never play.
bIsSpectator - Player is currently a spectator, might play in the future again.
bPlayerIsWaiting - Player is a Spectator that wants to join the match again.

#

I'm trying to get an overview of what functions to override/use to get this properly working

glacial hamlet
#

yea it makes sense that way. I know reading the code in the past I found a couple pitfalls here. For example, if the spectator isn't replicated, things become a little trickier. Afterall, you don't really need the spectator to be replicated and if so, only to owner.

thin stratus
#

Yeah, but that only entails the Pawn

#

I'm not even that far yet

#

I simply want to say "Player XY goes from Playing to Spectating."

#

And then use "bIsSpectator" to put him in a different list in my UI

#

As far as I can see, I def have to override "GetNumSpectators" and change it to use bIsSpectator.

#

Or rather write my own function

#

Cause they see Spectators that aren't ONLY spectators still as players.

#

Which I guess makes sense in some cases.

glacial hamlet
#

I think we ended up doing a ClientGotoState function in the player controller to accomplish that portion. As for the number itself, I can't say we've had to tackle that, sounds like you're on the right path.

thin stratus
#

Yeah, they seem to call this:

            NewPC->bPlayerIsWaiting = true;
            NewPC->ChangeState(NAME_Spectating);
            NewPC->ClientGotoState(NAME_Spectating);
#

For seamlessPlayers that return false for "MustSpectate"

#

The bIsSpectator boolean is missing though

glacial hamlet
#

right. sounds like you've reached the edge of the what's default supported.. I'm guessing bIsSpectator wasn't ever realized to be used in conjunction with the state of the PlayerController like this..

thin stratus
#

Yeah, so either you are only spectator or not

#

Welp, guess I have to poke around the function and see what needs to be overridden

glacial hamlet
#

😐 good luck! If you have some amazing realization it'd be nice to see how you improved it

#

for us it just wasn't worth spending time more than minimally working for our game, so we never dug too far in except to bug fix sync issues between server / client due to how death occurs for us

thin stratus
#

Yeah, I will let you know

high current
#

How can I generate a random value and keep that across all clients

zenith yarrow
#

Is there a way to uniquely Identify a session we are about to travel to.

So suppose I have hosted a session with a particular map. And a client finds, joins and then tries to travel to that map, but before the client travels.
I destroy my session on the server, change the map and host again. In this case the client joins the new map on this server because of the way client travel works for NULL online subsystem (haven't tested steam yet).

Is there a way to stop this before hand using a session ID of sorts, as in a way to join/travel only in that particular session with a specific map or settings for a single host.

thin stratus
#

@glacial hamlet So, I'm not 100% sure that it's working yet, but I did the following:

#
  1. I override void APlayerController::BeginSpectatingState() and call Super and added the line PlayerState->bIsSpectator = true; to properly mark the Player as Spectating.
  2. I override void APlayerController::EndSpectatingState() and copy paste the original implementation of the parent. Then I added a return; right after the UE_LOG, so that we can't use this when marked as SpectatorOnly.
  3. I override bool APlayerController::CanRestartPlayer() (or bool AGameModeBase::PlayerCanRestart(APlayerController* Player)) and add !PlayerState->bIsSpectator to the condition of being able to restart.
  4. I added two new Functions to the PlayerController void StartSpectating() and void StopSpectating().
    4.1. In StartSpectating I call ChangeState(NAME_Spectating) as well as make sure that the Player dies when already playing. I also remove them from the team they are on (if they are on any).
    4.2. In StopSpectating I call ChangeState(NAME_Inactive), which will end the spectating state and place the player into the "You can now be respawned" Inactive State. In addition I also find a new team for the player.
#

@glacial hamlet

#

Not 100% sure if that covers all of it yet.

fluid flower
#

@thin stratus nice investigation, the unreal spectating stuff is very very old dusty code and we decided to skip it altogether for that reason, I hope it works out for you!

thin stratus
#

Yeah I'm not 100% sure yet how the Freezing is handled though.

#

The Inactive State marks you as not frozen after the MinRespawnDelay

#

I'll probably also override void APlayerController::BeginInactiveState to instantly unfreeze

fluid flower
#

yeah also the whole state stuff, not just in spectating, there's some of that named states in gamemode too

#

blegh, skipped all of that and never looked back

thin stratus
#

Not sure if setting the MinRespawnDelay to 0 would work, as calling a Timer with time 0 usualyl doesn't call the timer at all

fluid flower
#

what's the result you're looking for btw?

thin stratus
#

In the end, just a basic "opt out of actually playing and enter spectate mode"

#

Similar to how CounterStrike does it

fluid flower
#

ah yeah

#

we also had some other issues with spectating, where the spectator has super jarring camera movement

#

sorry not camera, actual other players were jaggy

thin stratus
#

Yeah but that's further into movement

#

This is mainly about flagging the player as spectator

#

And being able to work with the booleans to show them in different lists

#

as well as making sure that they are skipped for respawn events and such

fluid flower
#

yeah I understand, I honestly would suggest to skip their system, but if you're close to fixing it, i hope it works!

thin stratus
#

We have another GameMode that would place you into Spectating when you die, as you only have one life.
So that all needs to work hand in hand and I think with the provided changes that might work

#

Ah well, the system of calling "RestartPlayer" etc. works without issues

#

It's really just the bIsSpectator stuff that wasn't working

fluid flower
#

yeah I do use RestartPlayer etc as well

thin stratus
#

So the BuildIn respawn system of UE4 shouldn't have issues

fluid flower
#

yeah that all works fine for me

thin stratus
#

Ah ok, thought you included that in "skipped all"

#

Well, I#ll make sure to put that into my wiki up until I have time to maybe write a small post about it on the UE4 wiki

#

if it ever gets fixed (broken format)

fluid flower
#

spectator part I meant

twin juniper
#

For some reason when I package my Dedicated Server, it's just completely empty

#

It's 2000kb file

#

but when I open it in a hex editor, its just 00000

high current
#

Hey, I am trying to do a little procedural room creation, I have 3 rooms that should be attached to something upon begin play

#

Now the issue is that I cant get the static meshes to show up in the right location

#

as they are below the level in the editor, and on runtime i set transform to a blocking volume that has all of the things in the room as its children

#

objects inside blueprints that are physics, show up, and stay in place, its just that the static meshesh, even though everything is set to movable

#

dont move

#

and what ends up happeing to the clients, is thatas soon as they enter a room they get teleported physically to the location in the editor of that room

#

Oh, fixed it

#

the array holding the shuffled procedural rooms wasnt replicated, so each client was in a different room

low pond
#

With match making when ISessionInterface::StartMatchmaking is called how is the caller meant to specify relevant player data for the match maker?

jade gazelle
#

Where would you guys typically put a loot system that is handled entirely by the server? Game mode? Actor Component that can be attached to each individual NPC? Somewhere else?

jagged garden
#

what do you mean by loot system

#

like an inventory that the player can loot

jade gazelle
#

Basically. I have a player inventory system already set up but need a method for the server to create temporary, global inventories that anyone can access for when an enemy dies

jagged garden
#

im working on something exactly like that

#

i have a replicated inventory component on the actor itself that the player can interact and take items from

jade gazelle
#

Ahhh, cool. So you have it as a component on the individual NPC.

jagged garden
#

yeah

jade gazelle
#

That seems like the logical place but I wasn’t sure if Game Mode would somehow be more secure

#

Trying to be very careful about everything I implement and make sure there is no way to backdoor or abuse the system

#

How do you prevent multiple people from simultaneously looting and creating duplicate items? Do you have a boolean check or something to see if another player currently has an active loot widget?

jagged garden
#

yeah i do

#

the only thing i was worried about with that is what if they opened it at the same time

#

but idk if thats an issue

jade gazelle
#

Yeah I don’t know how many milliseconds you would have to worry about that being an issue

#

Or if player latency would affect that

#

Something to look into

jagged garden
#

as long as the variable is being set on the server i doubt there would ever be any overlap

#

now that im thinking about it

jade gazelle
#

I don’t know enough about the specifics of networking to know how much of an issue that would be... maybe there are 2 checks, one to open the loot window and another to actually loot an item. That way if 2 people somehow simultaneously created a widget there would be another system in place to prevent multiple items being distributed

#

I think the likelihood of 2 people opening the window at exactly the same time, and then looting the same item at exactly the same time would be pretty small

jagged garden
#

yeah

#

that would work

#

and with latency theres no way it would be exact

jade gazelle
#

Right

#

I’ll have to do some testing later tonight. For the enemy inventories do you just have each enemy randomly generate a number of items from a data table or something like that?

jagged garden
#

yeah i use data tables with ids

jade gazelle
#

Cool, same here. The other day I was trying to decide between putting all items on my database server but opted for now to just keep them in UE. The database server just stores what itemIDs are in what slots in the players inventory

#

Can probably bypass that entirely for enemies since there’s no reason for them to have persistent data

jagged garden
#

right

glacial lotus
#

Are ragdolls supposed to be replicated? I have my characters replicated but when they die and ragdoll kicks-in then the ragdoll clearly detach from the regular version in the server(that stays put where they died)

jagged garden
#

imo its too much strain for the server

#

if its not critical to gameplay then u shouldn't

limber plaza
#

@thin stratus Hey! Re your q about how to spectate. In my game when the player dies, that message gets sent to the game-mode, then the game-mode deides whether or not spetating is legal (Aka in a team game if someone dies I dont' want them to spetate & give info about other players to their teammates, but in a free-for all, go straight to spetate when you die. Makes sense that game-manager controls that for me.). Then the game mode makes my player controller possess a spectator pawn, instead of its character pawn. Then again GM is responsible for handling a message like - the player wants to spawn.

#

What do you guys think about that approach? I've never used the bIsSpectator, unless mutating it directly...

summer rivet
#

so does UE4 out of the box support HTML5 Clients that can connect to a listen or dedicated UE4 server? I saw some older posts about adding a separate plugin/library but no real mention on if it's updated or built in working now. I see it tries to connect to a different port but no options in the settings to enable web socket support

knotty kelp
#

Anyone know how to increase the UE4 server tick rate?

#

Everything I find online isn’t helping.

#

With NetServerMaxTickRate in the engine.ini

loud wolf
#

is there such thing as replication id?

#

normally, in a game, when I compare the same replicated object over the game, the result is that they are equal. but once I join/rejoin an existing game, they're are not equal anymore.

#

is there a better way to compare replicated actors?

#

example code:

OnDie(this)

OnDieEvent_Implementation(AActor* ActorKilled)
{
    if (ActorKilled == this)
        // here!
}
#

this happens on a custom ACharacter class

lean river
#

Networkguid should be same i think

loud wolf
#

nevermind, everything's fine except that when joining in progress, other existing object are not being registered to our custom event system. 😅

thin stratus
#

@limber plaza The later Process of possessing a Spectator etc. is not the problem

#

It's more about making sure that UE4 internal also handles you as a spectator

#

BEcause I am using the RestartPlayer stuff

#
  • I'm worried that other Session related things might turn up returning incorrect data if bIsSpectator is being used wrong
#

I could easily ignore the boolean and create my own system, but I rather make sure it works with how the engine wants it

near knoll
#

Hello
i am having a problem with steam server
i am sure i have set every thing Correctly ,,
once i try to join the game,, server crashes

#

This is the log file

#

i have been tackling this error for weeks with no luck

lost inlet
#

has anyone run into an issue in >=4.20 where seamlessly travelling to the same level sometimes fails for connected clients?

thin stratus
#

I hope not lol

lost inlet
#

it's completely random and the client gets "Unable to travel to '<path to map here>' - package is not a level"

thin stratus
#

Is that in connection with a subsystem

lost inlet
#

this comes from FSeamlessTravelHandler::Tick() when LoadedWorld->PersistentLevel is nullptr when there's a valid loaded package and world.

thin stratus
#

Do you see any changesd compared to 4.19?

#

I'm currently working with 4.20, but the MapVote feature isn't final yet. Will have to wait 1-2 days before I've done that. Until then I can't test traveling atm

#

Well "can't" in the sense of not having the time

#

But I'll keep it in mind and notify you if I run into the same issue

lost inlet
#

that was where we discovered the issue, GetWorld()->ServerTravel("?restart") was also triggering it

#

going to see what changed in 4.21 if anything, haven't upgraded yet

#

though i discovered an odd thing, we have a TransitionMap set but it's not added to the cook list

near knoll
#

@lost inlet

#

i am having a problem with steam server
i am sure i have set every thing Correctly ,,
once i try to join the game,, server crashes
This is the log file

near knoll
#

anybody

summer rivet
#

I got the html5 networking working but from what I can tell you can't have HTML5 networking and the normal networking at the same time on the server so no 1 server with web and standalone clients connecting?

thin stratus
#

Shouldn't the underlying code be the same?

#

@summer rivet

#

I mean, I can connect to a PC Server with a Phone for example

summer rivet
#

yeah but that's using the same network driver isnt it? from what I had to do for HTML5 was replace the existing one with the experimental HTML5 driver

#

I barely understand the engine part of UE4 networking so maybe I am wrong and they can both exist. HTML5 uses a separate port so that part won't conflict atleast.

thin stratus
#

I never used more than one NetDriver

#

I do however know that the NetDriver thing is an array of definitions

#

So there could be more than one placed into it

summer rivet
#

well I guess that's what I try and find out now then lol 😃

#

damn but the DefName would be the same which would be a problem I would assume

thin stratus
#

Ah you are right

#

The second one would be BeaconNetDriver etc.

summer rivet
#

maybe? I dunno lol that's where my lack of knowledge breaks down heh

thin stratus
#

Yeah, so do you have to use the WebSocket NetDriver?

summer rivet
#

well if I want to connect to a HTML5 client it does

thin stratus
#

Thing is, PS4, XBox, Google, iOS and PC are all different systems and you can crossplay them

#

So you don't have to use the specific NetDriver

#

If you use the IP one it should also work

#

At least worth a try

#

@summer rivet

summer rivet
#

well I don't know how to make it work then

#

using the default driver and HTML5 client it tries to connect using web sockets on 8889 and fails

jade patrol
#

Hey guys, do you know how can I modify Player State Score variable ? why I can only get it but not set it ? i'm trying to set up a mp scoreboard (edit: I guess i need to create my own player state and player state variables ... strange)

thin stratus
#

Yeah the don't expose the Score variable

#

:D don't ask me why

limber plaza
#

Hey Cedric, WHY

#

Hey this is a very hilariously stupid question but here it goes anyway:
Let's say I'm running my dedicated server build on my compy, w/ steam subsystem all configured to my appId, session started, and the map open w/ listen param, (...waiting for players!). Is it correct to say I should be able to see this session & join this game from my WindowsNoEditor client - on the same computer?

#

Expected answer: Yes.

high current
#

how does the default C++ player state get the player name, I would like to recreate that in my own player state with BPs

limber plaza
#

It has to do with which subsystem you are using I believe.

#

So if you're using steam, it's going to use the steeam user name. if you are using null subsystem - then I think it's like... the name of your computer?

high current
#

yeah, but how can I get that

#

nvm, I think i should stick with getting all pawns spawned

#

I am banging my head against the wall, trying to make a hud system that shows all the currently connected player's health

#

to everyone

limber plaza
#

Sorry! I'm actually not really understanding the question I realize.

#

You can get name from player state, in blueprints.

high current
#

Y, Ik, but I am not using that player state

limber plaza
#

Erm. Oh. Why not? It's useful!

high current
#

Because I need to insert player health

#

in there

#

to access it client side

limber plaza
#

Oh ok you're saaying you have a custom player state. that's ok though

#

As long as your player state inherits from player state, it has a "name" property on it.

high current
#

I am sure there are better ways of doing that with the player state

#

without*

limber plaza
#

Yea that may be another topic, but I think health is best stored in your Character / Pawn

#

Why? Because that's the thing that is taking damage.

#

Other things will probably take damage too, other objects without a "player state" for example.

high current
#

I have it there ofc, but I need to get it to other people's hud

limber plaza
#

Ah gotcha.

high current
#

keep in mind, I am not thinking straight due to game jam stress, so some obvious solutions might not be apparent with me :d

limber plaza
#

Haha! Np, so your original q -

#

you -do- have a player state, for each player.

#

and you can just get "name" from it...

high current
#

yup

#

but as we were discussing this I realized I actually dont need any names

limber plaza
#

D'oh!

high current
#

I need a color associated with a player

limber plaza
#

I suggest blue.

high current
#

so I am thinking I use the game mode, to assign a map

#

playercontroller/color

#

then in the widget, get that color\

limber plaza
#

nod makes sense.

high current
#

and do the thinkg so on

#

as everyone has access to game mode rite?

limber plaza
#

Mmm... no. GameMode is only owned by the server.

#

But, game mode can assign the "team" parameter on a joining player's state, and that player state property can replicate.

high current
#

soo

#

I should cast to the controlled pawn

#

and set the value there?

limber plaza
#

Well I think it makes sense on player state actually! Because... Ethin is Orange, no matter what dude he's possessing, he's orange (on the scoreboard). Orange is he.

high current
#

oh yea, since I am not using names

limber plaza
#

But the color property on player state will replicate from server to all clients

high current
#

i can make use of my custom player state

limber plaza
#

You have the power.

high current
#

see I told you it takes me a while to get obv stuff 😄

limber plaza
#

Slo & Steady wins the something something

#

GL

high current
#

it doesnt seem to work

#

I even have a print string that is supposed to print the color in the character itself, on begin play

jagged garden
#

Is the first screenshot in the game mode

high current
#

Yes

jagged garden
#

Correct me if I’m wrong in your case, but it doesn’t seem like the “handle new player” is being called when a player joins

#

The event “postlogin” should run when a new player joins

high current
#

@jagged garden could very well be

#

Thanks for the help, i will try again after i get a couple of hours of sleep

jagged garden
#

Np

#

Maybe to check if it’s being called add a print string after you set the color that says something

hasty adder
#

oof why is it so hard to figure out if your logged into steam in engine or not, need to swap between using steam name or platform username

hasty adder
#

oh dur has subsystem =

vale mauve
#

So does the player controller exist serverside and clientside?

hasty adder
#

ClientSide, but the server has access to it - other clients do not

vale mauve
#

Gotcha, okay then this might not be a multiplayer issue, but I keep getting crashes when I try to handle cheats in a custom controller class

ABasePlayerController::ABasePlayerController() 
{
    CheatClass = UCustomCheatManager::StaticClass(); 
}

bool ABasePlayerController::ProcessConsoleExec(const TCHAR* Cmd, FOutputDevice& Ar, UObject* Executor)
{
    if (!HasAuthority())
        return false; 

    bool handled = Super::ProcessConsoleExec(Cmd, Ar, Executor);
    if (!handled)
    {
        handled &= CheatManager->ProcessConsoleExec(Cmd, Ar, Executor);
    }
    return handled;
}

It crashes on the handled &= CheatManager->ProcessConsoleExec(Cmd, Ar, Executor); because CheatManager is null

#

I thought if there was a client/server player controller, it was crashing on the client because you wouldn't want to have the CheatManager client side (sorry, I'm pretty new to writing network code 😦 )

hasty adder
#

not sure about cheat manager, if its something to even be adjusted i imagine server would have to tell the client to turn it on

#

out of my scope of knowledge :<

vale mauve
#

Yeah handling console commands in generally seems like sorcery ha. Couldn't find too many good resources on the net for it

vale mauve
#

all of the AFTPawns or all pawns in general?

fossil spoke
#

If an Actor is destroyed by the Server and that Actor is replicated, then all Clients will also destroy that Actor.

#

Are you sure that "all the pawns" are of that type?

#

Replication does not get turned off because its end of match

#

Are you sure that "all the pawns" exist on the Server and your Client didnt accidentally spawn one itself.

#

If a Client spawns an Actor itself, the Server wont know about that Actor.

keen halo
#

Hey,
If I have an Reliable UFUNCTION, and that function has other functions inside it.
Do they need to be marked as Reliable as well to make sure they execute? Or do they "inherit" the Reliable property?

fossil spoke
#

Reliable is a UFUNCTION specifier that is used in conjunction with the RPC specifiers Server, Client, NetMulticast. It is only use is to identify if these RPCs are required to ensure that they are acknowledged as having arrived on the other end.

keen halo
#

Yeah I know I need Client / Server / NetMulticast.

#

But do I need the specifiers on the other functions inside?

fossil spoke
#

The RPC (function with those specifiers) is changing the network context of where the execution is.

#
MyServerFunc()```
Calling the above function is sending an RPC to the Server from the Client to then run that code on the Server.
#

Anything inside that function is already being called by the Server, because the function itself is declared as an Server RPC

#

You dont have to specify other functions as RPCs

keen halo
#

@fossil spoke Thank you

safe marsh
#

anyone know of a UDP plugin for UE4

#

need to send/receive udp data at a high tick rate

bitter oriole
#

@safe marsh What exactly would you want from that ? Pretty sure UE4 does UDP already

#

I mean UDP support is ten lines of C code

#

Look into FSocket, FUdpSocketReceiver

#

There's a Rama tutorial on the wiki too, IIRC

safe marsh
#

I am not a competent coder

#

need to sent/receive udp data from the blueprint layer

fossil spoke
#

Use a plugin

#

There are plenty around that do what your after.

jade patrol
#

hey guys, do you why Set Timer by Event runs only on server ? can I make it so it runs locally ? (nvm, the replication params do not show after event is delegated ...)

worn nymph
#

@safe marsh i wrote a custom udp class that does what your after can send data locally between two editors or packaged games and even across internet for example with one program beimg hosted on aws recieiving data from any other computer havnt got round to making it a plugin just yet as ive been working on other stuff . but ive exposed it all to bp functions so its easy and highly custpmisable

safe marsh
#

thats cool man, yea need to send/receive data from a non unreal server

bitter oriole
#

@safe marsh If you really need to send lots of UDP, Blueprint won't be a serious option

#

What exactly are you trying to do ?

#

There might be easier options that hardcore UDP

safe marsh
#

cant really speak about it as it's an NDA project in tencent

#

😦

#

well I can say at least I am streaming controller information

#

and it's prototype, not commercial, so it doesnt have to be performant

bitter oriole
#

That's not really going to work well with Blueprint imho

#

UDP is lossy, so you're going to be doing some pretty complex processing to handle cut strings etc

safe marsh
#

yah I am using finterp between lost packets

#

but it's the spec I've been asked to use

#

I am gonna try to build one of the UDP plugins, I have seen some sample ones online but am not 100% sure how to build it

#

seems prettydecent

vale mauve
#

Anyone know why cheats wouldn't work with a custom cheat class?

#

Are they just not setup for networking situations by default?

thin stratus
#

Doubt a lot of people ever touched the cheat engine of UE4

#

I assume that even the stuff called from the cheats will have to be RPCd to the Server to work

vale mauve
#

Yep, seems so

#

Looking at the shooter template, it basically forwards any additional arg from a custom Exec command locally and uses ConsoleCommand() to send it to the server

#

kind of a strange way of doing it

thin stratus
#

Anyone know what I need to do to an AI Bot so they go properly into the NAME_Inactive state?

#

They sit at NAME_None when being created and my respawn loop requires NAME_Inactive

orchid niche
#

how can i make an actor replicate to all clients except 1 in c++?

thin stratus
#

Hm, IsNetRelevantFor I guess

#

And then making sure you filter the person in there

orchid niche
#

ah, ill have to look into that. thanks

steady tendon
#

What is the return value of the GetWorldDeltaSeconds if executed on dedicated server?

fossil spoke
#

The deltatime of the server?

steady tendon
#

@fossil spoke yes dude

#

If dedicated

fossil spoke
#

Sorry i shouldnt have put the ? That was the answer

#

It will be the DeltaTime of the Server.

#

I was quizzical because the answer seemed obvious

steady tendon
#

Oh, i though that dedicated servers returned 0 as deltatime or something like that because they are not rendering the game

#

I think i still dont understand the delta time 😦

fossil spoke
#

They dont render a viewport but they still need to process information

steady tendon
#

So their deltatime should be really small?

fossil spoke
#

Think of it as TPS (Ticks Per Second) instead of traditional FPS

twin vault
#

their deltatime should be around the configured TickRate

#

(even if the server execute faster, it will wait)

steady tendon
#

So in clients the tickrate is determined by the configured one or the frametime if it is greater than the configured one

#

But on dedicated servers they are static (the configured one) right?

#

So if i execute GetDeltaWorldSeconds in a component i need to execute SetComponentTickEnabled to true right?

fossil spoke
#

The DeltaTime isnt tied to a component. It is how fast the last tick was executed

#

You can read it without your component needing to tick itself.

steady tendon
#

Allright

#

The question comes because i am calculating the remaining time for certain events, so when one event is finished, for each event i need to recalculate its remaining time to finish. But there might be some precision errors

#

And the new calculated remaining time for one event could be 0 or even negative

#

So i need to clamp it, but i needed to figure out what should be the minimum value

thin stratus
#

Wouldn't using a simple timer for that be better?

steady tendon
#

And i thought the delta time

#

Yes im using a timer, am refering to the time of the timer

#

The shortest remaining time is plugged into the timer time

thin stratus
#

DeltaTime is just the time between two ticks

fossil spoke
#

Timers already keep track of their own time dude

steady tendon
#

Oh so i can put a value like 0.00001?

orchid niche
#
struct ENGINE_API FActorSpawnParameters
{
    FActorSpawnParameters();

    /* A name to assign as the Name of the Actor being spawned. If no value is specified, the name of the spawned Actor will be automatically generated using the form [Class]_[Number]. */
    FName Name;

    /* An Actor to use as a template when spawning the new Actor. The spawned Actor will be initialized using the property values of the template Actor. If left NULL the class default object (CDO) will be used to initialize the spawned Actor. */
    AActor* Template;

    /* The Actor that spawned this Actor. (Can be left as NULL). */
    AActor* Owner;

    /* The APawn that is responsible for damage done by the spawned Actor. (Can be left as NULL). */
    APawn*    Instigator;

    /* The ULevel to spawn the Actor in, i.e. the Outer of the Actor. If left as NULL the Outer of the Owner is used. If the Owner is NULL the persistent level is used. */
    class    ULevel* OverrideLevel;

    /** Method for resolving collisions at the spawn point. Undefined means no override, use the actor's setting. */
    ESpawnActorCollisionHandlingMethod SpawnCollisionHandlingOverride;```
if i set `Template = AActorChild`, will the spawned actor have the same properties as the child too?
steady tendon
#

I thought they were limited by the tickrate

thin stratus
#

A Timer executes multiple times per tick if the time is smaller than the tick rate

orchid niche
#

Owo

steady tendon
#

@thin stratus So i will plug a static value like 0.01 or something like that

thin stratus
#

e.g. if your Timer loops every 2 seconds and DeltaTime is 4 seconds, the timer would execute twice in that tick

steady tendon
#

Ok ok, i thought they were limited by the tick rate

#

Nice

thin stratus
#

If you put 0.01 in the Timer seconds it will execute every 0.01 seconds

#

If ticks have a different value, the timer might execute multiple times during that tick

#

Or not at all if the ticks are faster

steady tendon
#

So it would be better to clamp it to the tickrate?

thin stratus
#

No, just put whatever value in there what you need

#

If your timer should execute every 0.01 second, then put that in there

steady tendon
#

The value changes depending of the remining time of the nearest event

#

The timer doesnt loop, it fires when the remaining time of the nearest event has elapsed

#

So i think the tick rate would be nice

#

As a minimum value for the remaining time