#multiplayer
1 messages ยท Page 307 of 1
Then wtf are you talking about
in 4.14 no it doesnt
So, you haven't once tried packaged?
Might as well test it out...
I am telling you that there are differences, maybe 4.14 issue, between Editor and Packaging
i'll push heavily on the issue being with 4.14 - i'm moving this to UnrealAnswers tor tech support there
thought i'd ask here to see if people had the same problem
...
Anyone here having run into issues replicating MotionController keypresses to client where VR isnt enabled? I have a 2 Pc setup - one running a spectator client(no vr) and a client running a vr pawn. When using events that are run using MotionController keypresses nothing gets send to the server.
@worthy wasp Well, I'm back now :S Seems like it's still not fixed. It is not working only when connecting via ip correct?
to add on my previous question... Im seeing some very wierd behavior here.
I have this simple setup in my PlayerController
When I run this code with a normal pawn and no HMD, everything works.
But as as soon as I turn HMD on inside one my clients, all RPCs stop working
Anyone knows how to get around this?
Input is still working?
yes, "Client" is getting printed on my client
@thin stratus Im thinking this might be because I turn on the HMD after I have joined the session. Might be worth doing a transition map between the menu and the session that turns on the HMD
Hm last time I connected to a Server as a VR client I made sure that my .exe has -vr
Yeah. in this case the game has two modes, a spectator or VR - so when you open it up first time you're prompted using a standard window, if you select VR it allows you to connect to a session and then when the session is joined, it turns on HMD features
Tracking and everything works 100% as long as you are the server, as soon as you are the client with HMD on, the RPCs stop working
But you are testing that in standalone or?
right clicking on the uproject file and launching 2 instances on 2 different computers. One with HMD and one without
Hm okay
Weird, RPCs only stop working if ownership is wrong, the actor isn't set to replicate or the net connection is dead
so might be because ownership changes when the HMD turns on
Na, you are on the playercontroller
That's yours, if that owner changes then you have other problems
You are sure the vr client correctly connects?
yes. when I remove the turn on HMD, the print strings works as you would expect on my client instance and server instance
and the HMD is handled after the session has been succesfully joined
I had problems using enable hmd
That always returned false for me
That's why i ended up opening the VR client with - VR directly
Might have to try and create a seperate project where I open one with VR directly
and see if I get the same errors
I don't know what that could be. Is printing the PlayerController name in tick firing correctly?
will try, hang on a sec
So like once for the server playercontroller and two times for the client?
You can open your projects with - VR directly. No need to create a new one
You only need your UnrealEditor.exe path and the uprojects path. Then you can create a bat file with commandarguments
yeah I know, but my joining system interface is not enabled for VR yet :p
Skip the joining
Just use the console
The VR preview allows that too
Open ipaddress
arhh true.
Anyways, to answer your question, yes printing controller name in tick works as you would expect
2 times on server, once on client
Okay other idea to test that
Open the editor and set the connection to be not made when you start the game
It's in the advanced settings
Anyways, one way I could get around this is saying "Fuck syncing triggers on the server" - for the application I am doing I only need to sync the meshes transform I am moving with my controller. This is not a open multiplayer game but a closed conference project
Then start the game in editor with 2 players
Let one host and one connect as a vr client
And then breakpoint the playercontroller
And see what really happens
Yeah, think it needs single processes active
Then you will see a new boolean
Which says something about connect to server instantly or so
Set the player count to two
arhh
That should enable the bool to be set
Could be that this ends in weird things in the vive
As you have two windows on a single procrss and the vive doesn't like that
But debugging should still work
Hmm, seems like they are still interconnected as the Print Strings shows on both instances, even with the bool off
arhh. Anyways, when connecting it works as you would expect. 1 string on client, 2 strings on server
Yes okay but since you are in the editor now
Open the playercontroller BP and set a breakpoint on the server rpc
You can also filter the playercontroller instances and see what lights up if you press the key
yes, that works fine. Breakpoints activates fine on the server. Do note: Turn on HMD doesnt work when using PIE
Turn on HMD aka enable hmd?
Hmm. hold one... When I fire the RPC from my client, the breakpoint doesnt activate, but the server writes the string anyway. But when I fire the RPC from my server, breakpoint actiavtes
okay so it seems like the client PC cant fire the RPC
Makes not so much sense
What else are you doing when joining as VR
Something breaks if you do that
Hm despite the GameInstance variable replicated which makes no sense and the pawn being saved to a variable after spawning while the controller has GetControlledPawn for that it seems all correct
I will try and start up a new uncontaminated project and so some basic stuff and see if it works
Might have to rebuild some of this from scratch if this works
trying to go back to basics
@thin stratus Hey Cedric, you know a good bit about multiplayer. Both the clients and the host must forward port 7777 (Or the default) to connect with the client-server model via IP? Or just the host?
Oh, I see. Cheers ๐
@thin stratus okay so I did a complete basic test. When the app opens in VR and one in normal - everything works as you would expect
RPC etc. are firing and motioncontroller triggers work
So it happens somewhere in your existing code?
Need to get ready for city, so won't be able to help the next few hours
or its a problem with turning on the HMD during execution and not from the beginning
Yeah that's what I thought
so I will have to work around that by designing the interface to also work inside a couple of vr glasses
@thin stratus just wanted to says thanks again. I got everything working when I start one instance as VR and one as normal! Had to do some stuff with the interface but it works alright ๐
(: Sounds good
Was anyone able to remove full games from the SearchResults of a FindSessionNode?
If you paste "MaxPlayers" to the Options list I get automated Kicking when the session is full (that's cool) but the session is still visible
I tried AGameSession::UpdateJoinability(FName InSessionName, bool bPublicSearchable, bool bAllowInvites, bool bJoinViaPresence, bool bJoinViaPresenceFriendsOnly);
And setting bPulbicSearchable to false once it's full ,but that didn't help
@chrome bay Did you encounter that yet
Or don't you have a ServerList?
I do but it's basically the same as Alan Noons wild west shooter thingy, I hacked it together quickly a couple years ago... my latest venture with parties etc came from my starting to redo it properly haha
Can you not change the advertisement type of the server once it's registered then?
Okay so just so you know, if you pass "MaxPlayers=16" it will kick player who join back to the main menu if it's full
By default
Oo that's interesting
Does it give you a text warning, i.e. like "server full" or somethng?
void AGameSession::InitOptions( const FString& Options )
{
UWorld* const World = GetWorld();
check(World);
AGameModeBase* const GameMode = World ? World->GetAuthGameMode() : nullptr;
MaxPlayers = UGameplayStatics::GetIntOption( Options, TEXT("MaxPlayers"), MaxPlayers );
[....]
}
FString AGameSession::ApproveLogin(const FString& Options)
{
UWorld* const World = GetWorld();
check(World);
AGameModeBase* const GameMode = World->GetAuthGameMode();
check(GameMode);
int32 SpectatorOnly = 0;
SpectatorOnly = UGameplayStatics::GetIntOption(Options, TEXT("SpectatorOnly"), SpectatorOnly);
if (AtCapacity(SpectatorOnly == 1))
{
return TEXT( "Server full." );
}
int32 SplitscreenCount = 0;
SplitscreenCount = UGameplayStatics::GetIntOption(Options, TEXT("SplitscreenCount"), SplitscreenCount);
if (SplitscreenCount > MaxSplitscreensPerConnection)
{
UE_LOG(LogGameSession, Warning, TEXT("ApproveLogin: A maximum of %i splitscreen players are allowed"), MaxSplitscreensPerConnection);
return TEXT("Maximum splitscreen players");
}
return TEXT("");
}
"AtCapacity" checks this:
oh I see it there.. 'Server Full'
bool AGameSession::AtCapacity(bool bSpectator)
{
if ( GetNetMode() == NM_Standalone )
{
return false;
}
AGameModeBase* GameMode = GetWorld()->GetAuthGameMode();
if ( bSpectator )
{
return ( (GameMode->GetNumSpectators() >= MaxSpectators)
&& ((GetNetMode() != NM_ListenServer) || (GameMode->GetNumPlayers() > 0)) );
}
else
{
const int32 MaxPlayersToUse = CVarMaxPlayersOverride.GetValueOnGameThread() > 0 ? CVarMaxPlayersOverride.GetValueOnGameThread() : MaxPlayers;
return ( (MaxPlayersToUse>0) && (GameMode->GetNumPlayers() >= MaxPlayersToUse) );
}
}
At the bottom in the else
It normally takes "MaxPlayers"
No idea what the CVar thing is
and how it works
oh yeah that's wierd... wtf
But it seems to be = 0 by default
Might by command vars that you pass when starting a Dedicated Server or so
I think it's cus you can set 'MaxPlayers' in a config file somewhere
even so that does still look odd
Yeah
We also have these in the GameSession
bool AGameSession::KickPlayer(APlayerController* KickedPlayer, const FText& KickReason)
{
// Do not kick logged admins
if (KickedPlayer != NULL && Cast<UNetConnection>(KickedPlayer->Player) != NULL)
{
if (KickedPlayer->GetPawn() != NULL)
{
KickedPlayer->GetPawn()->Destroy();
}
KickedPlayer->ClientWasKicked(KickReason);
if (KickedPlayer != NULL)
{
KickedPlayer->Destroy();
}
return true;
}
return false;
}
bool AGameSession::BanPlayer(class APlayerController* BannedPlayer, const FText& BanReason)
{
return KickPlayer(BannedPlayer, BanReason);
}
@thin stratus wait, game session had this kick player? I had to do it myself to be able to kick players in the UI lobby
Well yeah, glory C++
no idea how to use AGameSession, thought that you had to modify the engine to use that
gonna look into it later
No
You can just create a ChildClass of that
But you need to also have a Child of GameModeBase
as that one (why ever) is hardcoded to use GameSession
And the Variable that you can set in the GameMode BP window does nothing
gg
Even if you set this
It stil ldoes this
{
return AGameSession::StaticClass();
}```
Screams for a PR to actually use the GameSession variable that the GameModeBase has defined
:D
that is true haha
But I feel like Epic doesn't want to expose that to BPs
Too complex xD
But yeah if you override the function i just quoted
I guess Game Session doesn't reallty have a lot you can do in BP's
with the StaticClass of your own GameSession class
or with the variable and then set it in BPs
you can have your own gameSEssion
Just make sure to set the GameSession to "Blueprintable" in the UCLASS
otherwise it's C++ only
Well it doesn't but the funtions are really not that complex
You could easily expose all of them
- making the GameSession base class Blueprintable
No idea why that's not a thing
I mean we also miss a "UpdateSession" node
I will try to update the current session
And stop advertising it
Thanks, I will check that tommorw when I wake up , might have to change my code to use the game Session
as for the not visiable thingy I just don't show it in UI but that's kinda hacky
but again the plyer can only see it when they search sessions
They get kicked if it's full anyway
I really wish they can do something to at least make the session results update in real time
until we have quantum computers and lightspeed internet connections we are slaves to async stuff ๐
@thin stratus have you had any problems with game session with your project? i was having troubles overriding functions, but later found it was apparently a logging issue. the problem is i need the logging to help figure out how to code it lol ๐ specifically i was trying to run RegisterServer with no luck
i'm on UE 4.14
RegisterServer, DedicatedServer, Steam, 4.14 Launcher Version?
But untouched?
correct
Then you are "simply" missing a PR that fixes that
Steam + Dedicated Server is broken otherwise
oh, good to know! i'll try to find that, thank you much!
do you know if that PR is on the official github or is that the one that's out there made by some other guy on another repo?
official github
Yes
awesome, thanks again
So, for whatever reason, I can't get the NameSession from the Subsystem NULL
FNamedOnlineSession* NamedSession = OnlineSession->GetNamedSession(GameSessionName);
Hm cool
Seems like OnlineSubsystemNULL has no Sessions registered
coolio
-.-
haha
ahh.... multiplayer
ShooterGame will only get us so far
and UT mods the engine
sigh
whaaaaaaaaaaaaaaaaaaat
I have a BreakPoint on "GetNameSession"
And sometimes it calls and the Sessions Array is empty
and sometimes I have the Session in there
WHAT IS GOING ON
Are you calling it at a point where you know the session has been active for a little bit? Only think I could see there is a race condition ๐ฎ
I created the Session on my first Instance
(barring pure magic)
it gets added to the Array
then a new client connects and the SERVER tries to update the session
but the array is empty
ยฏ_(ใ)_/ยฏ
FLIP THE EDITOR
it's an editor thing
again
if I start it as standalone, it works
But even with the UpdateSessions thing I can't get the Session from Appearing in the list
So
I would simply say
SubsystemNULL does not support hiding the Session
I just looked through the SessionSearch code
and it's searching for all open LanBeacons
Just a plain Broadcast
and then fills in the Results
it's not even checking if they advertise or not
void FOnlineSessionNull::OnValidQueryPacketReceived(uint8* PacketData, int32 PacketLength, uint64 ClientNonce)
{
// Iterate through all registered sessions and respond for each one that can be joinable
FScopeLock ScopeLock(&SessionLock);
for (int32 SessionIndex = 0; SessionIndex < Sessions.Num(); SessionIndex++)
{
FNamedOnlineSession* Session = &Sessions[SessionIndex];
if (Session)
{
bool bAdvertiseSession = ( ( Session->SessionSettings.bIsLANMatch || Session->SessionSettings.bAllowJoinInProgress ) && Session->NumOpenPublicConnections > 0 ) ||
Session->SessionSettings.bAllowJoinViaPresence ||
Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly;
if ( bAdvertiseSession )
{
FNboSerializeToBufferNull Packet(LAN_BEACON_MAX_PACKET_SIZE);
// Create the basic header before appending additional information
LANSessionManager.CreateHostResponsePacket(Packet, ClientNonce);
// Add all the session details
AppendSessionToPacket(Packet, Session);
// Broadcast this response so the client can see us
if (!Packet.HasOverflow())
{
LANSessionManager.BroadcastPacket(Packet, Packet.GetByteCount());
}
else
{
UE_LOG_ONLINE(Warning, TEXT("LAN broadcast packet overflow, cannot broadcast on LAN"));
}
}
}
}
}
Interesting to dive into the Packet data stuff
So basically, this happens if someone receives the broadcast
And this line defines if we responed:
Session->SessionSettings.bAllowJoinViaPresence ||
Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly;```
Which, funny enough, doesn't even check if bSouldAdvertise is true
LOL
haha
null subsystem is hax basically
all the things we could fix if we could be bothered to do PR's haha
Yeah but
dammit epic just use perforce so I can help lol
lol
So what do I need to do to stop it from sending packages back, let's see
Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly needs to be false
Session->SessionSettings.bAllowJoinViaPresence needs to be false
( ( Session->SessionSettings.bIsLANMatch || Session->SessionSettings.bAllowJoinInProgress ) && Session->NumOpenPublicConnections > 0 )
NumOpenPublicConnections needs to be = 0, which I don't know how to do
bIsLANMatch is true anyway
Damn
Lemme check if the NumOpenPublicCOnnections is 0 anywa
Alright, NumOpenPublicConnections sorts itself
So lets try to set the other things to false
coolio, works
So I finally found out how to hide sessions that are full
For SubsystenNULL at least
@thin stratus thanks for pdf!
:P haha, np
@cedric_exi numopen public is for public joinable stuff
But you got private too
Which is for invites
An invite will perform a search too
So keep in mind that scenario
Is there a better way of teasting VR Multiplayer?
It's hard because everytime we want to try something we have to package our game
?
Nah, package
that's the best and only way to really do it
It's not that hard
It will save you more time in the end
well, it does work just fine like that
Because I've been noticing a lot of things that are different between Editor and true Compiled builds
I see
Yeah, I lost 6 hours of dev time tracking down a stupid bug
Game worked fine in editor, but didn't in packaged
Just curious, what ended up being the isue with that?
6 hours. Lucky :). I spent 2 days debugging why my packaged game had issues I didn't have in editor.
@brittle sinew It is in the hands of Epic now
I mean, we alerted them to the problem. it's a known issue
Divide and conquer
lol
Launch game doesn't allow my friend on another pc/ another headset to connect
I got some general bugs in packaged.
I think most of it can be fixed by making sure the right check mark boxes are checked
There is this one where the client player can't apply damage to the server player.
All it's doing is a sphere trace for objects and applying the damage to the hit object
@thin stratus so how do you hide full sessions for NULL?
also, I wanted to ask, if I'm making a custom session, you said that I have to do it in the game mode, so does all game modes in my game have to have that override?
or just the main menu one
if I'm having a sort of item shop for a match, just something that you buy stuff from for the duration of that match
the items only give states, they don't exist in the world or have any use either than that
but I want if the player died and respawned to have their items still
and maybe other players can see those items online as well
should I put the item inventory on the pawn or the player state or the player controller?
or something like have them in the pawn but with a ref of only important info like a struct array on the player state for other players to see?
the items themselves are UObjects
@red ledge, If inventory persist after death, use PlayerState
yeah it does, goonna use the probably but thought gameplay important stuff should be on pawn or player controller
it really depend, and you can easily get playerstate from character
hello who knows , how i get player name over head as a Widget , as text render ist works
Does that seem like a reasonable flow for master/instanced ( on demand ) server flow?
With a back-end handling players allowed to connect
Since the client would be the only one with valid information about itself when it's moved to a new server
Mass instances would be pre-match instances that players can roam around in while waiting for a match.
My goal for the project is to have a four tiered system ( Back-end API, Master Server, Large instances (max 500), and Small instances (max 20)) and then spin up large/small instances as needed using docker and dedicated servers.
@red ledge Custom Session Class is like a Custom GameState, PlayerState, Character etc one. So yes, your GameMode defines the session class. The GameMode of your running game should have that. The MainMenu doesn't need to if you don't need any functionality there. I often don't even have a game mode for my main menu
And for the Inventory question: might be good to save it on the PlayerState. Mine is a component so I can stuck it onto everything i want
It's currently on the PlayerController
@thin stratus I mean, I do the hosting in the main menu (you basically click host game and write some stuff) and I have a diffrent game mode for the lobby and another diffrent one for the game, so should I put the GameSession class override in all of them?
You put the GameSession override in the GameModes that have GameSessions active
Your MainMenu normally doesn't
I mean, if you have functions inside of the GameSession class that you need in your mainMenu
then yeah, then you need to override it there too
An easier way would be simply creating a new Base GameMode
overriding the variable there
and then just reparenting the other gamemodes
probably gonna do that, thanks
I think you need to modify the source to make your own online session settings tho, right?
Hey, i have read that binding functions to umg widgets is performancewise fast , but doing it with setting the value directly is faster. The thing is, i canยดt get it to work and i canยดt find any documentation on this for now. Casting to the UMG widget directly to change something with custom event does not work like it does with binding.
Bindingss to functions / variables is slow. It's better to just modify the widget component in place, even if you do it from ticking.
Widgets don't replicate if that's what you mean
Each client has their own local copy of a HUD which updates itself locally, not via the server
you'll quickly run into the bandwidth limit trying to update client huds from the server
So why does function binding work and direkt custom event node not ?
+does not
This does replicate if its setup by binding. But not with custom event.
Huh maybe i lack the knowledge to explain this better. All i found was this statement : All that said, it really doesn't matter, all the binding options are much slower than setting the value directly. So if you need performance, avoid binding all together, set the values directly on the widget.
So i canยดt figure out what to do if i want to just to that as Nick Darnell says.
Okay and maybe health isnยดt the right thing to use here but i wanted to do the same thing what the binding does but manually. Page 33 http://cedric.bnslv.de/Downloads/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
@red ledge No you can simply inherit from the existing ones
check ShooterGame for that
@thin stratus can you explain why we use binding function for health if this is performance whise not the direct way ? I really want to understand that part.
@material the non-direct way is to set the actual value of the object
For example, if it's a progress bar, you do UProgressBar->SetPercent(HealthRatio);
It's faster to do that in the 'NativeTick' of a widget, than to use a binding
I am already doing that. But i cant understand how to set up that this is replicated.
You just replicated the Health value, and the clients update their widget on tick
The server has no knowledge of client widgets, so it can't call server functions on them. Widgets have no ability to replicate
As I said, they don't replicate - so you can't do any networking functions with them
Hmm so this Set percent needs to be done outside the widget ?
No it needs to be done in the widget - but you just replicate the health value
The widget updates itself on tick
By 'getting' the value from wherever it's replicated from
In your case, looks like the character
I donยดt get it. This setup works with binding and tick. But not with Custom event inside the widget. So with binding health is replicated from my character. But with custom event not. Why and how to fix it then
Or isnยดt it possible to prevent updates on tick for Widgets ?
because the custom event isn't firing
You're trying to run a multicast event to set the percent - which will NEVER fire on the clients because widgets are not replicated
clients have their own local copy of widgets / UI etc - which is in no way linked to the server
Ok this now makes more sense to me now. That raises the question again what " all the binding options are much slower than setting the value directly" means. How this needs to be set up
So a binding is kind of a separate 'object' in itself under the hood, which needs to be managed and taken care of - it therefore has overhead and has a cost of it's own.
They're convenient but slower than setting the value directly - BUT you probably won't notice a difference unless your game is very UI heavy
@thin stratus thanks, I will check the shooter example, AGAIN
Ahhhh you closed my Knowledge hole on this one perfectly now. Setting up values directly i therefore only possible if you set a variable inside a widget and let it read over event tick ? So you leave out this binding extra path ?
*is
Yeah it works !
Thanks man. This was quite hard to ask ( for me, iam bad at asking things)
I did. But i didnยดt understand it out from there. This tiny little bit "So a binding is kind of a separate 'object' in itself under the hood, which needs to be managed and taken care of - it therefore has overhead and has a cost of it's own." was needed for me to understand this topic.
I often need this informations side by side alongside the tutorial or i canยดt go further / canยดt process information. Thats why it can be quite hard for me to to tutorials myself. Anyway. Cool to know this now and i can read deeper into it
@chrome bay
Can you set the tick rate in widgets? If you can change that instead of using the delay
tbh the delay there is probably just adding cost, setting pecent of a progress bar on tick wont really cost much ๐
Just to be clear, i am not afraid of performance costs haha ๐ I might sound like i am . But i wanted to understand the process. I never knew there is a tick rate setup for widgets.
?
@torn gust what are you doing?
What is that % value to? HP?
Yeah, so. HP/Damage is event based
You shouldn't run it on tick
Learn how to optimize your UI elements by driving updates through the use of Events.
While you are not afraid of performance costs, it's just bad practice
You might as well learn how to do it as efficiently as possible
Cool ๐ Thanks.
Yeah no problem. Not that what you were doing was "wrong"
Btw, the delay after the tick just leads to your progress bar lagging behind the actualy value by 0.1 s. The function is still called every tick.
Obviously there are multiple ways to a solution in programming
Yeah, there's no reason for that delay at all, but I figured he took it off after Jamsh said something
Jeah was a stupid idea in general. It was more of a test thing. Delays per tick would make sense for line tracing or something that would be expensive to do extrem often. Event binding on a custom event is crazy powerfull, but i never understood how to set them up properly.
My client is unable to damage the server in a p2p network.
Its a sphere trace for objects, if I set the RPC to "run on server" it does nothing, if I set it to multicast my client can see the sphere trace debug but no damage is applied
@gaunt kestrel will try to set it up myself. Hope i learned something and can help you. ๐
Thanks Mom! @torn gust
Yes
Ok this worked for me :
Yes?
What does that mean?
The only thing different on mine is the if statement and the self on damage causer
See that little base damage float ? I had set it up to 0 and nothing worked. Set it to 1 and it worked. ( I used a float of 10 on the Event damage side for constant damage)
Ahh okay
So if the damage is 0 it just doesn't call
Seems like it. But honestly i didnยดt know that or that i am sure its like that. Someone should correct me then ๐
Well I'm waiting for a package to come in then leaving for work
I'll give that a try when I get there
The tracing sphere is only visible on one window. Is this expected behavior ?
(dedicated)
Ah mistyped , non dedicated. Ok makes sense then. Haha
Wait, if this works from Server and from owning client which one is the right way ? From what i can guess , run the tracing on the Server favours all handling from the server which can mean that you saw you bullet hit another player but the server can decide you did not hit. On the other hand, shooting from the client side and hitting a target could lead to favour the least laggy player right ?
If it's set to multicast it's visible on both.
I want it to be able to damage no matter if you're host / client
Technically it's negative damage as it's a heal.
You mean multicast sphere tracing ?
Well if the event is set to multicast
I can see the debug sphere trace on both windows
Doesnยดt that mean you trace two times if you have 2 players and one shoots ? It should trace for every player. Hm
Only 1 set of debugs is coming up
Ok donยดt know. Damn this topic wonยดt get in my Brain soon.
It's okay! Thanks for your help. If what you did before allows client to damage host and host to damage client that will work just fine
Ah okay i overlooked that i did not drain the Healthbar on the other player and vice versa. So i assumed client side worked but it didnยดt. Need to use second Screen ๐ Since my Vive steals one hdmi port iam stuck with one screen hehe. Guess i have to set up the viewports so that i can actually see whats happening. Now its all server side (tracing and damaging).
Yeah right? Client can't damage
Whats up with projectiles not hitting players when the server is dedicated sever? Works fine on listen server
Ok even rays go through..
Check that your collision presets are correct and that you are correctly replicating the linetrace/projectiles
Figured out the problem, the projectiles were flying forward from the gun, and the aiming is done via animation blueprint, and looks like animation isn't performed in dedicated mode (which makes sense)
So I tried what you said @Glutamatkrieger#7878 but it didnt work
So i've deduced that the server isnt seeing the sphere trace
imma try setting up another RPC that does the same exact stuff but on the server
@gaunt kestrel I didn't really follow along, but are you doing a ServerRPC that should end in a SphereTrace but the SphereTrace never happens?
Are you trying that in Editor?
Heard earlier that RPCs in Editor with a VR Pawn are broken
Editor and Package dont work
Package actually breaks it more, things like turning on and off visibilty break
but only for certain objects
have you tried starting the Project with -vr as a parameter instead of using "Enable HMD"?
You can do that for example via command line
"PathToYourEngine/UnrealEditor.exe" "PathToYourProject/NameOfYourProject.uproject" -vr -game -log
Something like that
hey guys I am having a hard time getting my xbox one controllers to work
it's hell
they are plugged in and work in editor (moving the thumbsticks affect the editor)
but if I hit play the input is not received
pawn won't do anything ๐ฆ
:O Don't say that
@junior tree Well did you setup the Input things to use the Controller?
So you are making a Local Multiplayer game?
my pawns are put in the level and set to auto possess player 0,1,2,3 respectively
yeah
And you have 2 Controllers?
Well do you create a new player for the second one?
maybe I need to spawn more player controllers?
Yes you need to
yeah perhaps it's that, auto possess player 1,2,3 won't work I guess?
ok, then, I'll look that up. Thank you a lot you kinda saved my life for the jam
up to 4 players
essentially i have a fps version of my VR pawn that inherits all the inputs and everything.
thanks!
NP, it's old code but it should work
That code shouldn't work o.o
you're not spawning any player controller I see?
it was included in part of Mordentral's VR plugin. I'll post there
But it does
The "SpawnPawn" is NOT spawning a pawn
It's spawning a PlayerController
If you don't spawn an actual pawn and possess it it shouldn't work
All I know it worked when I played with it ยฏ_(ใ)_/ยฏ
great! I'll be doing that
ULocalPlayer* LocalPlayer = World ? World->GetGameInstance()->CreateLocalPlayer(ControllerId, Error, bSpawnPawn) : NULL;
This is what it calls
And "CreateLocalPlayer" does this
ULocalPlayer* UGameInstance::CreateLocalPlayer(int32 ControllerId, FString& OutError, bool bSpawnActor)
There yo ucan see that boolean is suddenly "SpawnActor" instead of "SpawnPawn"
if (bSpawnActor && InsertIndex != INDEX_NONE && GetWorld() != NULL)
{
if (GetWorld()->GetNetMode() != NM_Client)
{
// server; spawn a new PlayerController immediately
if (!NewPlayer->SpawnPlayActor("", OutError, GetWorld()))
{
RemoveLocalPlayer(NewPlayer);
NewPlayer = NULL;
}
}
else
{
// client; ask the server to let the new player join
NewPlayer->SendSplitJoin();
}
}
WHich is used here
So if you set that to false you won't get a PlayerController
Yeah
That Stream shows the same
He is spawning the Pawns with pressing START on the Controller
The Node is not spawning a Pawn althoug the boolean says that
No idea why you are able to access the "ControllerPawn" in your image @wary willow
Maybe it actually autoposseses the placed pawns that are in the level?
So who knows what I did there
so the create player function tells the game mode to check for player starts and spawn a player there
what if I want player starts to be single-use?
4 spawn points, only use one
Na the CreatePlayer function creates a new PlayerController
and then remove them accordingly
Right
You can then use that PlayerController to possess a pawn
my createplayer creates a pawn with a player controller at a random player start
empirically
that's what it's doing right meow
But it works?
Right
maybe I can just re-position the pawns after they are spawned
That node is so random then
If you uncheck that boolean you don't get a PlayerController
xD
You get a ULocalPlayer, but that's not helpful in BPs
Obviously, if you wanted more control, you'd need to go into cpp
and build a function yourself
oooh I can uncheck that boolean
Might be that the Node is hooked up with PlayerStarts
From PlayerState?
That could be although I can't find anything calling something for a PlayerStart
PlayerState has that override function right?
Sphere Trace still not showing up for client .-.
@wary willow Why suddenly PlayerState?
@gaunt kestrel Did you try to start it like I said?
I'm not using a VR Pawn, i'm using a third person pawn that inherits everything from my VR Pawn
I was wondering just thinking out loud
@gaunt kestrel So you are not even using "VR Preview" or "Enable HMD" somewhere?
@junior tree https://gyazo.com/8254ec9a17d13f0b3149c2f5b6f93521 in my pawn
Just in case you were wondering
I think I'm gonna die
And I have that player setup in GameMode
just Simulate, can't really test VR Multiplayer without going through the whole packing process
thats why we have the FPS pawn that inherits
Of course you can test that
0.o?
You can test MP VR via Steam in editor?
Just start the game as StandAlone via command line with -vr and then use the console to start listen server and one to open the localhost address
You don't need steam for vr
So you mean LAN?
I'm not using steam when packaging
A bunch of checks to see if they have a HMD or not, and @wary willow open level?listen on host, open IP on client
In the Editor?
In editor, that was simulate loads in as a different pawn
Here I'll show you after I try Stand Alone
Try this
:: Starts the specified Unreal Engine 4 Project.
:: Enables a LOG console, which is also printed to the projects "Saved\Logs" folder.
@ECHO OFF
:: Set your Paths here correctly
SETLOCAL
SET ProjectPath=
SET UProjectFileName=
SET EnginePath=
ECHO ON
echo "Trying to start Game"
echo %EnginePath% UE4Editor.exe %ProjectPath%\%UProjectFileName%.uproject
@ECHO OFF
start /d "%EnginePath%" UE4Editor.exe "%ProjectPath%\%UProjectFileName%.uproject" -vr -game -log
oh batch
... in console?
@twin juniper this is the correct channel to ask your question
Especially with Super MP Nerd Genius Exi here
I've never seen it, so I can't help
Beg Exi
But
It seems pretty self explanatory
SET ProjectPath="FULL DIRECTORY PATH" to project
SET UProjectFileName= try Full Path to uproject or Just the uproject name
EnginePath=Full Directory Path to Engine Install
hmmm
same with the rest I guess
Actually no
You won't need to input anything after those 3
It's done in the echo for you
Anyway, those are just guesses, never seen this or tried it, just using common sense.
did it work?
Remember that you need a console key
it was "Oh cool" to how it works
One bat execution
is one instance
you start it twice
First instance will be open MapName etc
Second instance wil lbe open ip
Anyway, off for today
hey exi so how do i remove a element in a TArray tha tis replicated in c++ but im looping through it in bps (I made an array to hold all my items and they are added by an overlap event). I then want to remove the item from the array when the player drags and drops the item off of the inventory interface (in umg)
what i need to know basically
is how do i access "Switch Has Authority" in bps
@thin stratus
@brittle sinew
I just wanted to tell you that I love you and I am happy to be here
@junior tree hm?
@twin juniper I told your ass to come here awhile ago when he was still here
The man is sleeping or having some fun
He gone
@twin juniper I think its something like
Pawn->Role < ROLE_AUTHORITY
How do I format code in this?
Pawn->Role < ROLE_AUTHORITY
lol
Role_authority
is an enum
lol
like theres an enum of all the different ones
i dont remeber them off the top of my head
I really wish discord had a spellchecker lol
ohh u wanted it in BP?
you can only call switch has authority from a pawn class
otherwise you have to store your player pawn and do a branch for "Has Authority"
or you can probably just do get player pawn 0 . has authority
if it's umg that's pretty safe since a server will never have it, but if it's just a standard blueprint taking player 0 should be replaced with get owner
otherwise the server will simply take the first user off the user stack
how do we open a map and have all currently connected clients join
Jumps the server to new level.
There's a bunch of those, but that seems like you best bet for your case ( There's ClientTravel, SeamlessTravel, and a few others if I'm not mistaken )
I'm in BP, run these as console cmds?
Works
Buggy part about that thing is with Steam it kicks out half the players for some reason
So you have to look into seamless server travel
But in turn that won't work if you want to change gamemodes
wait, what? I have seamless travel in my game and i can switch game modes
Well
Not sure how it would work in MP, but you could always Keep the same GameMode(actor) and just switch components in it
@civic light can you show your code? I have a main menu gamemode and I want to switch to my gameplay gamemode
are you using sessions?
@twin juniper SwitchHasAuthority is just a single node. I don't get the question. In BPs you simply rightclick and search for it
@gaunt kestrel To open a map and move Players with you, as a server, you use ServerTravel
BP doesn't have a node for this so you need to use it as a console command
@night jay @civic light MainMenu to GamePlay is something else than GamePlay to GamePlay. ServerTravel is used for the later. I never actively used Seamless Travel but i was told a while ago that this will keep the GameMode class
Its actually really easy to change the gamemode when using seamless travel. For example when a match is over, i call the following before ServerTravel. gamemode_class is just a TSubclassOf that i get from a function that randomly picks one of my gamemodes.
FURL &test_url = Context->LastURL;
if (gamemode_class.GetDefaultObject())
{
auto gamemodeobject = gamemode_class.GetDefaultObject();
test_url.RemoveOption(TEXT("Game"));
FString gamemodestring = "Game=" + gamemodeobject->MapPrefix;
test_url.AddOption(*gamemodestring);
}
Thanks
@civic light But this is ServerTravel
SeamlessTravel != ServerTravel
Changing the GameMode with ?game=GameModeShortName is something known so far
4.14 even features a functionality in "Maps and Nodes" to set Shortcut names directly in the Editor
Which was previously only possible with setting them in the ini file directly
oh, nice
But if you use SeamlessTravel, I'm still kinda sure (based on what I was told) that the GameMode class stays
Because the idea of SeamlessTravel is to keep Actors alive and, for example, move the previous saved data of your PlayerStates to the new map
Imagine something like Borderlands where you where traveling between zones
(always all together cause UE3 worked the same way)
That was probably a seamlesstravel
As you kept all the information ,the game mode, the PlayerState etc for the new level
But moving from Lobby to GamePlay where Lobby is probably a different gamemode, shouldn't work with SeamlessTravel
As that would mean the LobbyGameMode stays and the GameplayMap uses the wrong GameMode
that is what I learned. I never actually tested it as my first experience with SeamlessTravel was crashing in 4.6
yeah, its different when it comes to using lobbies
personally im not using them for my game
Well I have a lobby on the Marketplace
And I ServerTravel from Lobby to GamePlay level
I would love to keep selected stuff in the PlayerState and use "OnCopyProperties" and "OnOverrideWith" (can't remember which one is for the travel) to keep the data
But these functions need SeamlessTravel
so /shrug
I would like a semi-seamless Travel
Where you don't keep the classes, but you still have the ability to use the old PlayerState object to give the new one data
even if they are different classes
what sort of properties are you looking to keep?
Currently, the Players can select a Character and a Team in my Lobby
Since the Marketplace Project can't have Steam by default, I save the data in the GameInstance of each Player
And ask them in the GameplayMap for their choices
While this works, it's not really ideal
I could use Steams unique ID and save the selection together with the ID to the match them back up after they traveled to the Gameplay Map
But ideal would be, being able to Travel, getting all the new Class (gameMode and the classes that come with it) and having the PlayerState call "CopyProperties", giving me the instance of the old PlayerState (ALobbyPlayerState) so I can get variables from it to fill my "AGamePlayPlayerState"
But it seems like the whole CopyProperties thing is bound to SeamlessTravel and to the idea of keeping the GameMode and so also keeping the PlayerStateclass
i save data to game instance and than restore it on server
@thin stratus is there are some tutorial you know how can i "repack" advanced session plugin (any plugin) with few more functions added?
If they give you the source, you simply add the plugin to your plugin directory of your project and regenerate project files
then you can extend the stuff in their .h/.cpp files and hit build again
then you have the updated plugin
Nothing different than having a normal C++ project that you extend
it has directory with source, which includes classes, private and build.cs
im not sure is that all source, probably all?
๐
there are no bp function for is uniqueid valid, which give me nasty warnings all over the place ๐
its not for myself.
I have another question regarding seamless travel then
Can I change my default controller class
And does begin play happen in the gamemode after seamless travel?
ServerTravel "Levelname"?listen
or
ServerTravel "Levelname"
Also I'm having this weird bug where my client can't recieve inputs at all
didnt change anything, just opened the project this morning
Without the listen
Listen is only for the initial call of creating the listen server
@night jay Seamless Travel keeps the GameMode and so also all the classes you setup in it
So no, you can't change the PlayerController class if you use Seamless Travel
It's only meant for scenarios where you want to keep everything but just switch the map
e.g. Borderlands zone change
Issue is with Steam it's kinda necessary because normal server travel kicks out half the players
That's weird
Would do the other clients get i nterms of log errors?
I mean, either you loose all clients or none
Well that works now. Thanks!
Problem is client can turn and look, but cant move or do other actions
connection failed or whatever I can't remember exactly
But It's been bugging us since the beginning
Well seems like Steam ServerTravel only works if you set Seamless Travel to true
Which will cause this:
Seamless Travel Flow
Here is the general flow when executing seamless travel:
1. Mark actors that will persist to the transition level (more below)
2. Travel to the transition level
3. Mark actors that will persist to the final level (more below)
4. Travel to the final level
Persisting Actors across Seamless Travel
When using seamless travel, it's possible to carry over (persist) actors from the current level to the new one. This is useful for certain actors, like inventory items, players, etc.
By default, these actors will persist automatically:
- The GameMode actor (server only)
-- Any actors further added via AGameModeBase::GetSeamlessTravelActorList
- All Controllers that have a valid PlayerState (server only)
- All PlayerControllers (server only)
- All local PlayerControllers (server and client)
-- Any actors further added via APlayerController::GetSeamlessTravelActorList called on local PlayerControllers
Hm
Hmm it seems that no matter the pawn I load in for client it doesnt want me to use wasd to move it. (spectator)
Then steam is practically unousable if you want a lobby..?
Where you can actually connect to
So, I just asked Moss and it seems like this:
The GameMode should NOT override the Gameplay level one if it'S different
Seamless Travel only keeps it completely if you have the same gamemodes setup
Of course you can't use the features of Seamless travel if the classes aren't the same :x
what do you mean same gamemodes setup
I have a gamemode called MainMenu which is in my level's gamemode override
Then I server travel with a travel URL which includes a custom gamemode in the URL
Which does work if I have seamless off
First thing is: Your MainMenu is not really important here
MainMenu -> StartServer is a "hard travel", which means non-seamless
MainMenu -> JoinServer is also a "hard travel"
Only if everyone is already on the Server you call ServerTravel
I do that
So the Lobby, which you probably opened as the first map, has the Seamless Travel on
Lobby has a LobbyGameMode
and as long as the GamePlay map doesn't have the LobbyGameMode too, it should seamless travel without keeping the GameMode
If not then we have a bigger problem :D
Well I exactly have that already
And it doesn't
Although main menu gamemode and lobby gamemode are the same thing
My lobby is in my main menu
But that shouldn't matter
Server travel I try to load Deathmatch or whatever
Doesn't work
So
Without clients in there
What exactly happens if you call Seamless Travel ServerTravel from Lobby to Gameplay
It still keeps the mainmenu gamemode while I called it to use deathmatch
yes 100%
So far my team had to start the game and load a level and gamemode before people could join because of the kicking out
@thin stratus would it be possible if you were to make a small example on how to set it up? I might be doing something wrong here..
Currently no, sorry. Knee deep in work :(
Hello, all.
When I use the Create Session node and specify IsLAN = False, where is that session hosted?
Oh
But the Session can't be found online without a MasterServer
One question to make sure @thin stratus
If I have OSS Steam on, and have that also in the config
If I toggle LAN, I should be able to enjoy LAN out of the box, without additional setup?
Ah, that's what I thought. How does one go about setting up a MasterServer?
Because I saw somewhere that I have to do SubSystem=null for LAN
But is that just for if the game is only LAN?
LAN should work with Steam Subsystem
Right, just making sure.
Well, I never tried it so I can't say for sure either
@ocean dust Your own MasterServer? That's quite some work. There is a Plugin on the Forums that features a basic one.
But you might be better off using Steam (though remember they take 30% of your income from the game)
They take 30%
But, you get 10000000000000% more exposure
than you probably would alone
Our plan is to launch on Steam anyway. But yeah... -30% + -5% + -10% ...
True and a lot of additional stuff (like accounts etc)
Unless you had some crazy marketing and hype
@ocean dust Well, without Steam, you would miss a lot of buyers
Agreed
And you would need to host your own MasterServer
which is our plan
@ocean dust what's that 10%?
TBH, I would say, if devs wanted to start off a little slow, but earn max profits, use Itch.io
then, go to Steam/Humble/whatever other new crap is out there
Making games is HARD
I wonder what my taxes will be like.
I mean, I don#t know about your Country etc, but I would be surprised if taxes really are that low
Yeah you might only go home with ~35% of the actualy price
It's probably closer to 25% for taxes
But tbh, If you are getting roughly 30% as profits, that's still pretty good
And that's what you should be accounting for when doing budgets
Is there a guide for getting Steam integration set up? I think I saw one a while ago and shifted gears away from MP
but 25% is a bit dreaming
Yeah...we're trying to be realistic
but still fight to get something out of all of this work
Make it good
And it sells good :P
You can see how Steam Games sell iirc
How many copies
even if we net 2mil: 0.3 * 2,000,000 = 600,000
Yap
That's the power of passion for making fun games and experiences
Meh
ANYWAY
Steam integration? I need that for a MasterServer to host my Sessions?
That's why I don't create my own games xD
Yeah
They register there and your players can get a list of these back from the server
Of course Steam features a lot more
@thin stratus you don't create your own games?
what, I thought you had a VR project?
Like some exploration type game
In my eyes, for me, a VR Project wouldn't cut it
@thin stratus I'm making my own games
More work than a normal Game
Less buyers cause of less people having a Vive
I would rather work on a non-vr Game
But as a single dev without any skill in art, I can't do that anyway
Maybe at some point in the future getting into one project with Celeste, but that's just a thought
@thin stratus You gave up on 3d modeling?
It takes too much time atm
Wait, why aren't you two doing something now together?
Freelancing for money needs time
Because both of us work on clients + she works on her Gamejam game with that leaf
No time to start another project
I'd love to see what the "cute couple" could come up with
Oy
lol
Actually...
Just saying...
You could probably use that as a marketing strat
ยฏ_(ใ)_/ยฏ
:P Na
My relationship and my job are two different things
If I end up creating a game, with or without her, i want to sell the game, not my relationship :P
Right, but there's always a chance of wedding bells
And then you're definitely merging some stuff together, other than yourselves
$$$$$
We are both heavily learning slate atm for editor extensions and maybe after I finished that one
Also want to go back learning Substance a bit more
was fun to create these textures
Anyway, food and watching some series
o7
hi, anyone here with expireince in blueprint networking mayhem with interfaces between actors, specilly pawn->interface->weapon->interface->enemypawn, i know i have some kind of owner problem, really dont know even if my idea is possible. did i peak anyone intrest to help me?
for those willing to take a look: https://forums.unrealengine.com/showthread.php?134678-Networking-problem-with-interfaces-between-actors&p=654583#post654583
Hi all,
I have been playing around with trying and implementing a items/weapon system with multiplayer. Now i have come to realise that my idea maybe is not possible, i have been banging my head against the wall for a day now, i think i have tried everything i can come up with. Please i hope someone can shed some light for me on this one.
I have a "player character" that for now, on begin play just tells the server to spawn and attach a weapon to my "player character":
126028
In the
I've found 4 different Steam integration guides and they are all out-of-date as far as I can tell
Oh sweet! I need an up-to-date guide on Steam integration
@stiff rapids Shouldn't the Weapon be in charge of determining what happens when it "hits" something?
@stiff rapids The Weapon should say "hey, Pawn, take some damage"
Instead of the Pawn determining "I was hit, therefor I need to take damage"
@ocean dust this one worked for me http://allarsblog.com/2016/02/26/BasicSteamIntegration/
Unreal Engine 4 Specialized Engineer that does Other Things too
Allar's is good
@hallow shore Nope, tried that one
My cook step says UEBuildConfiguration.bCompileSteamOSS is deprecated
and fails
engine ver?
@stiff rapids UE4 has damage system build in
@ocean dust, yes, you are correct there, this is the end goal, but my problem is that the pawn is not reacting to the client correctly. even if the pawn right now decides what happens, the execution goes to remote instead of server, when the weapon calls the interface.
@stiff rapids OK, so, you are doing a raycast check on the Client when you press the button
@thin stratus Yes, i know that. ๐ just trying my own thing.
@stiff rapids You should send an RPC to Server to ask it to "use" your weapon
which will then to the raycast and messaging on the Server
@ocean dust Yes right now i am, i was doing it on the server before, same result, for some reason, the executon on the pawn goes to remote... i feel like i am doing somethig with interfaces that i am not suppose to do..
@stiff rapids This graph specifically is not running on the Server:
I guess I don't understand what "the executon on the pawn goes to remote" means
Somehow the Inteface call is executing on the Client?
@ocean dust for simplicity i am executing much on client right now. let me try explain
Any other Steam integration guides out there that are correct for 4.14.3?
@ocean dust the fire weapon logic, it just finds any actor attached to my pawn, that implements a weapon interface, then it send the "use" message. The use message gets to my weapon actor, its fires the event use, which does a trace, if it hits a actor witch in its turn has a interface called on hit implemendet. the weapon sends onhit interface message to that actor. Now, the last actor witch recivies the onhit messages, fires onhit event, this event takes "health variable", says to authority to decrease it by some ammount. Healt variable is onrep notify. This onrep notify chages some text. If the OnHit interface call is made from the weapon as i want, is authority fails on the last actor, it goes to remote. If onHit is called from pawn directly with asimple trace, the last actor decreses its variable trough authority... sorry if i am unable to explain this clearly..
That all makes sense
With one issue: You are running all of this logic on the Client
You need to add a new Custom Event, set it to Run on Server Reliable
And call that event from your InputAction
yeah i get what you mean, this is the path i went from the beginning, and still failed. But turth to be told, i might have overlooked something, so i am going to try and rewire it again so it server side. One question, if i fire the first interface call "Use" from my pawn but run on server, does the rest of the chain execute on the server too?`
Yes. If the Custom Event that starts the logic has "Run on Server" then it will be running on the server
Amazing, just got it to work now, by doing as you said. Thank you. Much appriciated. THe interesting part is, the only difference now is that before all this, i was running the run on server logic on the weapon, it started there with the raytrace... now instead, i just run it even before that...
I am guessing that the sideeffect of having all running on server is that i cant see the raytrace debug info from the client view now, but that is expected i guess?
Uh hmm. I guess? I set up similar logic for my game to run on both cient and server for some lag prediction (but I'll probably drop the client logic)
Sure looks like that right now, as everything is server side, when the client shoots, the trace debug is drawn only on server(listen). I am still confused as to why it didnt work before when it was client side trace... i know its no good client side, but confusing it worked from pawn but not from attached actor. anyways, thanks.
So, My client cant see it's animation but the server can, and my server can see it's animation but the client can't. I am using am using an anim montage, are there certain things you have to do with anim montages when it comes to replication?
my code is currently setup like this
{
if (Role < ROLE_Authority)
ServerReloadWeapon();
else
ReloadWeapon();
}```
and all what reload weapon does is just play a animation
would the reload animation need to be replicated as well?
Yes, you need to play the reload animation on all clients
Make a NetMulticast RPC and call that from the server, which just calls the animation
Working in MP, you have to realize that most stuff needs to get called on all clients if you want everyone to see it. Things like AnimBPs exist on all clients so they work fine, but manually playing animations needs to be called multicast
Things like shooting and reloading are normally handled like this:
Client Pressed Button to Reload -> That moves the call to the Server with a ServerRPC and also does the same on the Client that pressed the button
You want instant reaction for the Client that presses the button, so he takes care of playing the Animation himself
On the ServerSide, you simply perform all the math behind reloading and multicast the reloading animation to the other clients
Filtering the original client in the Multicast call as you don't wanna do that twice
ServerRPC -> Reload the Weapon (math) -> Multicast -> Play Reload Animation (but not on the weapon instance that is on the original client)
/
Client Press Reload
\
Client Call -> Reload the Weapon (math) (Yes, you could technically cheat here, but the ammo is still replicated and shooting shoot be checked on the server!) -> Play Animation
Is there a way to set the extra windows for the other clients to appear spread out when you start playing with multiple players?
I see, now I think im beginning to understand, thanks
Hey, where should I go to learn about linking website data with ue4 gameplay?
Like having someone on a website interact with a player who is playing the game
Something simple like allowing a website user to select the music that plays for a player
probably something like VAREST, JSON, anything that will allow you to communicate externally with a server @vivid siren
Otherwise, you can see what the Twitch Integration plugin does
But VaRest is a plugin
(pretty sure)
awesome, thanks! i'll take a look
Yeah, looks like you can get request objects from server
But, no idea how that would get implemented with how you want it (I don't know crap about these things, only know the barest of minimums)
Hey guys, I have a question that I'm going to try to explain. I have a projectile spawning on the server and replicating and its amazing and thanks to the resources you guys sent me i got it working. The only problem is that for some reason, the projectile isn't firing anywhere near my crosshair. But if I fire the projectile on the client with the same exact values, it goes exactly where i want it
Does it have to do with the UGameplayStatics::BeginDeferredActorSpawnFromClass() function maybe?
LogTemp:Warning: CLIENT ROTATION: X=0.916 Y=0.399 Z=0.047
LogTemp:Warning: CLIENT SPAWN: X=1831.037 Y=798.989 Z=94.453
LogTemp:Warning: SERVER ROTATION: X=0.916 Y=0.399 Z=0.047
LogTemp:Warning: SERVER SPAWN: X=1352.710 Y=1462.012 Z=180.821
I'm multiplying the forward vector of the rotation by 2000 and setting that to be the Velocity of the projectile's movement component.
Are you doing the trace that decides where the spawn occurs on the server?
If so, you might be battling latency issues, but that far off seems unrealistic for that
No, I'm calling GetSightRayHitLocation from the playercontroller on the client, but even when I'm standing still they are way off
Is that a function you wrote?
Yeah it is, sorry lol. Forgot i did. It's just a function that shoots out a cast from the crosshair and checks what it hits
or where, rather
So you're calling the authoritative trace on the client, and the values aren't the same on the server? Based on the logs you posted up there
And why are you getting the trace hit location if you're just using the rotation's forward vector to spawn it? I'm not entirely following ๐
Well I'm basically using it to see if I'm aiming at something, and if I am then I set the rotation to be the rotation between the spawnpoint and the hitlocation, otherwise I'm just shooting it in the direction that my character is facing
// Returns true if hit something, and HitLocation is pass by reference
if (PC->GetSightRayHitLocation(HitLocation))
{
// Setting up the rotation and location of the spawn point for the rocket
Location = GetActorLocation() + (GetActorForwardVector() * 100);
Rotation = (HitLocation - (Location)).Rotation();
}
else
{
// Setting up the rotation and location of the spawn point for the rocket
Location = GetActorLocation() + (GetActorForwardVector() * 100);
Rotation = GetControlRotation();
Rotation.Pitch += 1.f;
}
FTransform ProjectileTransform = FTransform(Rotation, Location);
ServerFireProjectile(ProjectileTransform);
And those logs are printed immediately after spawning the rocket on the server and on the client. The rotation of the rocket is the same in both circumstances, but when it sets the velocity of the rocket, they are different for some reason
MovementComp->Velocity = ShootDirection * MovementComp->InitialSpeed;
ShootDirection is the "CLIENT/SERVER ROTATION" log above
Where are you getting ShootDirection from? If it's calculated on the client, it should be the same on the server...?
Yeah ShootDirection is calculated on the client, and it's the same on both the client and the server
FVector ShootDirection = ProjectileTransform.GetRotation().GetForwardVector();
Where is the location coming from then, the ProjectileTransform? If you're just taking the client's value, it would be odd if it was just different on the server
// Returns true if hit something, and HitLocation is pass by reference
if (PC->GetSightRayHitLocation(HitLocation))
{
// Setting up the rotation and location of the spawn point for the rocket
Location = GetActorLocation() + (GetActorForwardVector() * 100);
Rotation = (HitLocation - (Location)).Rotation();
}
else
{
// Setting up the rotation and location of the spawn point for the rocket
Location = GetActorLocation() + (GetActorForwardVector() * 100);
Rotation = GetControlRotation();
Rotation.Pitch += 1.f;
}
FTransform ProjectileTransform = FTransform(Rotation, Location);
It's all jsut coming from the client. And the rotation value is the same for both, but when I shoot the projectile they go in different directions lol. Maybe there's a weird collision thing happening?
Well, the logs you posted showed two clearly different locations, when are you logging that? From the client's info or from after it's spawned?
Because that wouldn't be a collision issue if you're just logging the info that came from the client ๐
Alright, I got Steam lobby hosting working correctly and was able to get two instances of my game to connect
BUT
When I attempt to change maps using ServerTravel
Only the listen-server travels
and the BeginPlay for their resulting PlayerController does not run
Are you using seamless travel? Someone else was talking about Steam not connecting clients to the next map
Is there another way to move between levels in Steam multiplayer?
And if so, the PlayerController not running its BeginPlay is intended behavior
Yes, I'm using seamless travel
Wait what
Ah, seamless travel does not run Begin Play?
Specifically for the GameMode and PlayerControllers, they persist
Well crap