#multiplayer
1 messages · Page 510 of 1
And also I lose all inputs and the like with that method, even things that should still work while feared
you could do
construct a SplineComponent (can use a PathFinding Query for points)
while its feared, disable all movement input, and just animate the character position over the Spline
drawback of this is that while you are doing that, you're basically teleporting
so your velocity is zero, and all animations based on it will break
you could check for feared flag, then construct a feared velocity from the spline tangent and max move speed though
Yeah exactly i thought about using SetActorLocation with collision checking but I’d have to fuck with animations
then it comes to a simple mutator
Well on the one hand there’s probably only like six people who will ever play my game so maybe cheating won’t be an issue :)
On the other hand it’s probably good to learn to deal with this stuff
GetVelocity() in AnimBP that returns velocity if not feated, or normalized tangent at spline point multiplied by walkspeed if feared
That would work, I’m trying to think if there are any other instances of outside movement input that could occur besides run in fear.
the benefit of a spline approach over just teleporting in a direction is that the client can simulate the movement smoothly
and simply
Well thanks for the suggestions, this was helpful
Did anyone have any idea regarding how many dedicated serves I can run on one instance
To be specific I m using Linux Dedicated server
Any rough figures will also help
Depends on your game and the server hardware.
@bitter oriole lets say it's a moba game and I m using 16 core and 32GB Ram
It depends on your game
Anything from 16 instances to 1, if you really want an estimate
So per core one instance
No
It depends on your game
Maybe your server isn't even enough
Maybe your game is so light and the server so powerful that you can run 20 or 30 instances on it
Maybe half the servers are empty
There is no way to know without testing it
Hmm makes sense
@bitter oriole I ran 20 instances of my server on Windows machine, and my windows machine is 6 core and 16 GB RAM
intel i7-8700k
and my windows was running smooth
How many players were playing on each of these 20 instances ?
0, I just ran it
So it's irrelevant
How about the average framerate on each of these ? It was 60 right ?
yes
how do I do that?
🤷
hahaha
Start by having 20 players connected to each of these
Because your test doesn't mean much
You can then proceed to log the delta time at each tick, and print a report on a text file somewhere
You should also measure the lag on clients to ensure the response time is smooth
You can then decide what the target performance is - should the server run 30, 60, 120 fps ?
And then you can see how many instances you can run while keeping your desired peformance
I was listening to Gears 3 dev talk and their chief engineer mentioned that they were able to spawn dozens of dedicated server on windows machine.
@bitter oriole I m noting this down.
You probably don't even want to run your dedi on Windows, really
Linux hosting is way cheaper
No, I just mentioned that if windows can handle dozens then on same hardware Linux can handled even more.
thats what i meant
and ofcouse Linux is way cheap, efficient and secure
ok, why?😕
you can package a development server executable with profiler support to really see how things are doing
@half jewel definitely gonna try this
Hey guys I am using Advanced sessions and was just curious how I can grab the avatar image of a player that accepts my invite on steam and display it on a widget
I'm getting different results on my client when I package my project as opposed to running in editor.. Is this a typical problem when developing multiplayer?
@subtle patio give an example, I Don't understand
Moving a unit to a tile, when running in editor returns 1 value and when packaged returns something completely different - vague I know, but I would have expected the game to work the same when in and out of the editor? I don't believe I'm using any editor only code
LAN
no dedicated
Fixed the problem
before I was passing the object reference
changed to passing the tile coordinates and it works
Hey everyone, I have this issue that even tho my server is set to 2 players max, players can still connect to it. I can't seem to cap it at all.
@subtle patio It can work if the actor is replicated (cause the actor will have a network guid which permit to retrieve the reference of the actor once on the server 😉 )
But in your case, that's ok!
I see, of course.. wasn't replicating the actor.
Second line of inquiry - testing multiplayer. Can you not use Hamachi and a LAN session to test a project?
so far opening my ports has proved unsuccessful in connecting a session to my friend's pc, and hamachi + LAN is equally as unresponsive
advanced sessions/steam requires you to use ID 480, and will not work internationally
Right, I hope I don't get the same answer that everybody always gives about getting your own App ID or whatever. Anyway, I've about finished playing around and making a cool game in Unreal Engine. However, I don't want to make this game for commercial use, so I have no reason to get my own AppID at the moment. It costs like $100 after all. I am pretty sure that I have multiplayer working as it should, using the Advanced Sessions Plugin + Steam, as when I play in standalone on two instances, these clients can connect and play with each other, even when the LAN box isn't ticked on session creation. Problem is, when I package the game, I can't find the session, no matter what I do. I've tried having another computer on the same network run a session, and I have tried having two instances of the game open on my own PC and I simply can not find the session. Do I have to open ports for Steam to work? I thought using Steam Servers would prevent this? I have changed the search result max to something crazy like 999999, as I'm aware Spacewar ID gets used a lot and you can pick up other instances, but this should be plenty. Any ideas?
that max search amount is more than enough (i have no issues with 10000), im not sure if this is the case but i have the port 7777 open for UE4 and i can connect. like you said i dont think it should require any port forwarding going through steam
^ I gave up on steam 2 days ago because it doesn't work internationally with ID 480, however even with port forwarded 7777 and the steam port forwarded 27015 I never managed to get steam server showing across 2 pcs and 2 steam accounts on the same network
might be of assistance to look through. no comments but its working, might show something missed perhaps?
I unfortunately used blueprints for my game, and not cpp as I haven't learnt it yet, but I've had a read through and nothing jumps out at me.
@ocean geyser Hey cheers mate, will take a look
Still no luck even though I opened up the ports.
So frustrating! Maybe it has something to do with blueprints as opposed to cpp
hmm it shouldnt unless theres something weird going on, ive used the advanced sessions in the past with luck
personally, if I wasn't going to actually get a steam ID or pay for some other online subsystem and it's for a small pet project, I would always just stick to good old reliable direct connection and live with forcing the host to forward a port (I can't say why it wouldn't work for Catch2, direct connection should be reliable, but it is confusing to diagnose when you're not familiar with it)
only sucks if you're on a dorm network or something that frequently blocks stuff like hamachi and other "random" net traffic
@hoary lark Imma wire shark and see what's going on with it - because afaik, just doing a straight up punch through with the ports should be fine, I'm in an apartment building, so I doubt they've got too much security in place
Thing is, my port forwarding 100% works, I have hosted other games servers and had people join even from USA (I'm in UK)
yeah I guess diagnose @red pollen problem more than mine
You using blueprints @subtle patio ?
yeah
Have you ever got this to work?
@not on this connection - just moved, I've provided firewall exceptions etc
but I've used hamachi to connect to other things
successfully, and the pings get through
When you answer could you tag me? Going to bed and don't wanna miss this ^^ ❤️
Hi all, do you know where I can set the voice treshold for activating VoIP ? It seems even with push to talk it does not trigger before a certain volume is detected
Found it : voice.SilenceDetectionThreshold or UVOIPStatics::SetMicTreshold for those interested
Hi, how i can make to only replicate specify variables to the owner (player) of the character? and not the rest of the players
Detailed information about how to conditionally replicate Actor properties.
thanks @glad wharf
i prefer c++, thanks !! 😄
Is there overhead in replicating an empty array via a rpc?
Anybody had the same issue as me and managed to figure it out?
The whole... can't find server when packaged?
listen or dedicated?
Your own appID?
No
That's what I'm saying though, if you scroll up a bit, how come people have got it working?
They increase the amount of requested servers by alot
Cause you will get tons of servers that ue4 filters out in the back but that count into the query for steam
So if you request 20 server and it returns 20 of other games then you won't see yours
Im o 999999
Well the safest is to get your own id
If you mind, im just gunnah copy and paste my little description
Right, I hope I don't get the same answer that everybody always gives about getting your own App ID or whatever. Anyway, I've about finished playing around and making a cool game in Unreal Engine. However, I don't want to make this game for commercial use, so I have no reason to get my own AppID at the moment. It costs like $100 after all. I am pretty sure that I have multiplayer working as it should, using the Advanced Sessions Plugin + Steam, as when I play in standalone on two instances, these clients can connect and play with each other, even when the LAN box isn't ticked on session creation. Problem is, when I package the game, I can't find the session, no matter what I do. I've tried having another computer on the same network run a session, and I have tried having two instances of the game open on my own PC and I simply can not find the session. Do I have to open ports for Steam to work? I thought using Steam Servers would prevent this? I have changed the search result max to something crazy like 999999, as I'm aware Spacewar ID gets used a lot and you can pick up other instances, but this should be plenty. Any ideas?
I also don't have the money to do that just for the sake of a bit of fun / learning
I've never had any issues using Spacewar
Maybe you can help then
CPP or blueprints? @jolly siren
Also, have you got it to work on separate networks / computers, using the Steam subsystem?
And did you have to port forward any ports?
Not very helpful for me, as I can't code in cpp so used blueprints.
And, used listen servers.
alright, good luck
I wonder if someone else can help me sort this, it's hurting my brain
See, what if I pump $100 into it, and it still doesn't work?
Like that's gunnah be even worse, I'm a student with no funds etc
I doubt it's the app id
I've done bp/cpp and listen/dedicated. I was just mentioning what I primarily work in
Okay... would it help if I showed you my Game Instance, where I create, find and join sessions?
The ports you need to forward are 7777 and 27015
Who is your ISP?
Do you have your own router or one you rent from them or both?
I have opened both of those ports
And I'm with Virgin Media
I suppose it's said I rent my router from them
But port forwarding does work, I've port forwarded a minecraft server with success
My game instance.
Have you tried disabling your windows firewall?
That I have not.
I'll give that a try
Would it just be the host, or the client trying to join too?
Host, but you might as well do both for the test
Gotcha.
Give me 5 mins.
Okay this is going to be very difficult for me to explain what is happening, but it's been a bit of a breakthrough.
Here's how it went.
I turned off my firewall on both pcs. I opened up the game on my PC. Could not host the server, the create session node was failing, really don't know why. The second PC could host a game, which I couldn't find on my PC. Note that the second PC, when the lobby loaded, had their steam profile picture and name attached to player card, as it should be.
Decided to open the game up again on both PCs, while the first instance was still running. In the 2nd instance (1st PC, where the session failed to create), I could create a session, however when I joined the lobby, the playercard had my actual PC name, not my steam name (Desktop whatever whatever), and the steam avatar was blank. I assume something to do with not being able to launch a game twice on steam so defaults to that. Fine. 2nd PC, 2nd instance, can find the game i set up on my 1st pc. Can join. Joins, and the same where it's not the Steam name and avatar for the playercard, but the PC name and a blank avatar.
What the hell is going on here xD It must be something to do with steam? Both accounts have the UK set in store preferences, and both are on the same download server (Manchester) in the steam settings.
Hopefully some of this information will help someone figure this out 😄 @jolly siren
Is there a way to select a camera for the player controller, on an actor that has multiple cameras, each of which will have its own camera?
Right okay
And make sure all instances of the game are completely shutdown before running again
check task manager
On it.
I'm trying to use Set View Target with Blend, which selects the first active camera. Which means I have to deactivate cameras in order for it to select the right camera. However, I don't want to do that because I want multiple players to control different cameras on the actor.
@exotic axle A camera has it's own camera? Inception
No, an actor has 3 cameras.
I have a tank that has 3 cameras: driver sight, gunner sight, commander sight. Each camera would belong to a player controller.
Set View Target automatically selects the first available camera
Normally, the way to do this in singleplayer is to just deactivate the other 2 cameras
Set bAutoManageActiveCameraTarget to false and handle it yourself
Is there a way to handle it in BP?
If you are limited to BP you will likely need to keep using the activate/deactivate route. You should be able to re-activate the camera for the next player that needs to use it.
Okay so a further update on the situation. I got a friend of mine to run the game, and my 2nd pc (None of these PCs have unreal engine files or anything, just the game), and they could create a server, join and play, none of them port forwarded and both have firewall activated.
What could it be if it was just my PC?
Should I just completely wipe my Unreal engine etc?
Setting bAutoManageActiveCameraTarget to false won't help me. That still wouldn't allow me to specify a UCameraComponent for view target. View target always only takes in an AActor
Correct
So I guess the right thing to do here is to separate each CameraComponent out into its own actor? :/
It's just hard to do that in my case because they're attached to bones on the skeletal mesh
attachtocomponent takes a socket
so all you'd need to do is add a couple of named sockets to your skeleton
That's what I ended up doing
I have an issue that forces me to use delay in multiplayer but I hate the fact that I have to use it:
- Spawn tank pawn (driver), possess with player controller
- Spawn tank gunner pawn
- Spawn tank driver view camera
- Spawn tank gunner view camera
-- Game starts, some time passes, everything spawned correctly --
- Possess tank gunner
- Set view target doesn't work on the OnPossess event for the tank gunner. Camera goes into the belly (origin) of the tank instead of the gunner camera as expected.
If I put even a 0.1s delay right after the event possess node, this works flawlessly.
In the BP picture: Tank is valid. Gunner view is valid. Incoming New Controller is valid and casts successfully to PlayerController.
All the inputs to the Set View Target with Blend node are valid when it's executed, yet it doesn't set the view to the gunner camera as expected.
There are no errors. The above block only executes once, on the server (because that's the possess event). I'm just frustrated that I need to put in these random delays to make things work!
uh, your options are pretty limited with BP @exotic axle
try ExposingOnSpawn GunnerView and spawning it before the GunnerPawn, push the reference to the GunnerView in it as you spawn it
and your bAutoManageCamera is false, correct? that sets/overrides the view target pretty aggressively
The GunnerView is already spawned way before OnPossess is run so that shouldn't do anything.
I'm open to doing things in C++ but I just want to prototype multiplayer stuff out in BP so I don't have to deal with BOTH the issues of C++ and multiplayer at the same time.
@exotic axle I'm in a similar situation,
I can spawn the camera & it's correct for the server player but after a client join the new client camera is correct for just one second & after that uses the default camera!
I've a custom camera from the base camera actor class
I'm trying to find a solution to solve the problem without the delay, I really don't like the delay 😄
Same here. Did you try the change he recommended using C++?
People are saying setting bAutoManageCamera to false allows more fine grain control
No, I didn't try that solution yet
Ah I fixed it with BP. You can actually set that variable on the player controller BP. Just need to override it.
Thanks for the help
I updated to ue4.24 and i need a ServerTarget for that version of ue4 im seeting up a dedicated server hears the tutorial that im following https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux) i try to build but it gives me and error about line 27 and in that line is this ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,ref List<string> OutExtraModuleNames
help
@exotic axle @wet oriole bAutoManageCamera find a ViewTarget for a PC as soon as it joins (StartSpot by default) and caches it
then whenever anything that can change the ViewTarget happens it sets the ViewTarget back to cached StartSpot
ending only after the Pawn is possessed
thing literally calls SetViewTarget 6-8 times during player construction
R00k, is your issue limited to clients, does the listen server host have it?
as there is a replication race condition involved for clients - VIewTarget in PC replicates before your TankView Actor replicates = you get what you described
and PC has higher NetPriority by default, so it happens consistently
@winged badger Thanks that variable fixed my problem.
Guys I'm using InputComponent->BindTouch(EInputEvent::IE_Pressed, this, &ABasePlayerController::MoveToTouchLocation); in player controller SetupInputComponent function but the problem is clients can't register input commands!
CameraActors on the level have a dropdown, something along the lines of Player<Index>
if those are set, that CameraActor for Player1 is paired with controller with the same index
and is used as a ViewTarget for AutoManageCamera
for that particular controller
Hi all, I was going through ActionRPG code. In character class the abilities are granted if its server, what if I m running dedicated server then the abilities should be granted by GameMode?
Can someone comment on this.
void ARPGCharacterBase::AddStartupGameplayAbilities()
{
check(AbilitySystemComponent);
if (Role == ROLE_Authority && !bAbilitiesInitialized)
{
// Grant abilities, but only on the server
for (TSubclassOf<URPGGameplayAbility>& StartupAbility : GameplayAbilities)
{
AbilitySystemComponent->GiveAbility(FGameplayAbilitySpec(StartupAbility, GetCharacterLevel(), INDEX_NONE, this));
}
// Now apply passives
for (TSubclassOf<UGameplayEffect>& GameplayEffect : PassiveGameplayEffects)
{
FGameplayEffectContextHandle EffectContext = AbilitySystemComponent->MakeEffectContext();
EffectContext.AddSourceObject(this);
FGameplayEffectSpecHandle NewHandle = AbilitySystemComponent->MakeOutgoingSpec(GameplayEffect, GetCharacterLevel(), EffectContext);
if (NewHandle.IsValid())
{
FActiveGameplayEffectHandle ActiveGEHandle = AbilitySystemComponent->ApplyGameplayEffectSpecToTarget(*NewHandle.Data.Get(), AbilitySystemComponent);
}
}
AddSlottedGameplayAbilities();
bAbilitiesInitialized = true;
}
}
@upper moat could you explain, I can help u with your issue.
Hi, im making a game with 1vs1 online versus for mobile devices. I think that dedicated server for this could be overkill, so i was wondering if someone has implemented something like this. I tried sessions but it doesnt work on mobile.
I m spawning in game menu on clients inside my player controller then in my gamestate im running a server event to update all in game menu... ofc the server doesnt know about the in game menu reference so i run the event on owning client
but i still get none for in game menu
how do i get the reference for the in game menu
how are you doing it
@gray scroll remember that there is a controller in server and client
this is run on locally controlled
then i m calling this inside a server event
@grizzled tide
my guess is
when you run getall actor of class
due to gamemode runs on server
it gets all player controllers from server not client
didi you check this?
If you try doing a get all actors of class thing on a client, it will only get the ones that are relevant(player controllers and pawns typically go in and out of the relevancy range)
Server, everything is there so you don't have to worry about relevancy
Yea i think i need to run owning client event after getting all actors
Will try that in a sec
Anyone else having issues in 4.24 after upgrading a project?
I can run for a couple of seconds only to be ported back to the inital position or some in between
Is there a possibility to launch two or more local clients from the editor? The first client then should be made into a listen server, while the others stay local and then can connect to the listen server later on. Using the advanced options always starts a listen server as well.
Or do I have to manually start a new game instance?
this is not something PIE can do by default
So, start PIE as normal, make it into listen Server and then start a new instance via Terminal/PS/CMD and use as client?
I managed to get everything working without delay (except the initial wait for everyone to join code that's going to change later). Thanks everyone!
So this has me more than a little confused. I'm just rotating an actor on the server with AddActorLocalRotation, and if I turn on the actor bReplicateMovement = true, the client sees a horrible stutter - but if I turn bRM = false, the client still sees the rotation but its much smoother and appears to be updating more frequently?!
it all happens in a ROLE_Authority block so it should only be updating the rotation on the server
is bReplicateMovement redundant to either bReplicates or bAlwaysRelevant, so I was somehow doing it twice?
Is there a way to check if a dedicated server is online via blueprints?
nvm i figured it out
i am spawning an actor on client so not replicated. I am calling a server event to get all my player controllers from game mode but i m not able to get their actors. Is there any way to get the actors without replicating it? I tried running an owning client even from server
if you spawn an actor clientside then the server doesn't know it exists
you'll have to call an appropriate event on an actor the server does know about, eg. the controller
Hello guys,
I'm a little bit in problem with my networking functions, this is my workflow:
1-Custom collision overlap: using 'Role == ROLE_Authority' to make sure only server version handle the collision
cast<APickup>(OtherActor)->OnUsed(this)
2-From the custom actor I'll call a function AddScore on the collided pawn
cast<AMyPawn>(InstigatorPawn)->AddScore(ScoreToGive)
3-In the AddScore function of my pawn class i just add the new amount to the current score & current score has a rep notify function
Score += GivenScore
after that I'll call a client rpc function to update score on the ui
ClientUpdateScore();
and recalling rep notify function for the server
if(Role == ROLE_Authority) OnRep_UpdateScore();
but the problem is at the moment the ClientUpdateScore() was called, score in the client is not updated & actually UI shows default score, in the next call the UI shows 1 for score but actually it's showing the previous update, the new score is 2
hi, im sharing gamelift working for 4.23. this repo is clone from yetigame gamelift plugin. feel free to use it.
https://github.com/ArifZx/GameliftClientPlugin
@stray tide hey, is aws gamelift expensive to use for indies ? is it the most cost-effective or the most costly service for hosting dedicated servers for unreal games ?
assume a situation like this, if there are a total of 1000 daily active users per day, and the game is something like a 1v1 ping pong for mobile, then per month how much would be an approx server cost ?
Im trying to determine how Crouch() in Character.h is replicated. Because I would like to replicate my own 'Sprint()' in the same way. Just not sure how because the number of different ways to replicate a variable/function is intimidating. So I'd like to 'copy' how UE4 did it
Any ideas on how to find out?
@stray tide i've seen that, but i think the cost scales based on usage, and i dont know the technical cost of actually running one in real life. I never made a multiplayer game before, so i'm trying to learn how to budget.
me too @magic pike, i think it's depend from your game. assume pingpong game use 50mb for running at server. 50 * (1000) / 2 = 25000mb ~ 25gb for your game by day. you can use this:
m5.2xlarge $0.15996 $58.3854 per Month. but in realife i still dont know
i just use it recently
it case is 1000 player in one time
1000 player in one time or at a day ?
but you can still decease that cost
so assume i use this
m5.2xlarge $0.15996
is there a limit to how many instances we can create at a time ?
i assume that every 1v1 ping pong match is its own instance
i still find that too
and similarly we will have many instances running parallelly
ok
i think it is the concept of instances and their relation to costs that is my biggest question to running a server
@stray tide this calculation is wrong
U can't blindly say it will only take 50 MB
The server executable is itself around 110 MB AND additional packaged files
All all be loaded into memory
@magic pike Gamelift is not cheap
The pricing which they are mentioned in only for 15 days
Amazon is trying to trick you. Read carefully the pricing page. They only mentioned 365 hours that's 15 days
And on top of that network urges are there.
So get away from gamelift.
thanks for the warning. I was wary about amazon from the start, but just needed to confirm.
which would be the best service for hosting your unreal dedicated server in your opinion ?
thank you @rich ridge i never tought that
I should explore the free instance though, it will help to make you understand how cloud servers works
I have explored the free instance of gamelift
Please do explore it
Hey, can someone experienced look into my project and tell me why dedicated server with 2+ players are slowing the game down( No it's not frame dropping or hardware) Thanks ❤️
ok, but assume i became a master at cloud computing one day and i decided to want to host a production dedicated server, where should i look to ?
in unity, there is the photon unity network service, and i know folks who are using it well. I supposed games built in unreal cannot use the pun service.
Heroic Labs builds Nakama - an open-source social and realtime server for games and apps. It includes a large set of services for users, data storage, and realtime client/server communication; as well as specialized APIs like realtime multiplayer, groups/guilds, and chat.
your master sever will have something like this
which will track the running instances, do some kind of match making, etc
interesting
you need to fork nakama and customize it
ok, so is it like a server library that has a range of libraries for providing things like social,data storage and realtime client/server ? I think we ultimately need to host nakama somewhere is it ?
yes
but if you can wait for a while, epic games has promised to deliver the same things for free
except dedicated server hosting
With Epic Online Services, we're making it easier and faster for developers to successfully manage and scale high-quality games. As a game developer ourselves, we've tackled numerous hard problems over the years. With Epic Online Services, we're sharing the fruits of our labo...
i think for my initial learning project i'm not really looking for anything fancy. I just want to make a simple online ping-pong 1v1 game for mobile with the servers running every time.
we will definately need some kind of master server to keep track of dedicated server, because epic games will not provide that
like testing the waters before i do something more ambitious
and where should the master server be ?
It could be anywhere, AWS ,Azure, Google Cloud
does all these services provide a capping feature ? to avoid being overcharged ? That is my biggest worry for making online games. Dont want to end up looking at the humongous credit card bill just to make a simple online game.
If you go with AWS, Azure or Google cloud, they do have some sort of framework available to ease the development, and you may think for starter I can afford few instances on these cloud at higher price, but what if you want to scale , you can scale on these clouds easily but how much you will pay for hosting -> HUGE MONEY
damn
@magic pike You can request to increase the instance count
@magic pike Just check this out https://www.digitalocean.com/pricing/
what they lack is some sort of framework to ease the development
they are damm cheap, they offer great service
we just need some kind of master server to launch instance and start game, thats it
nice
gamelift takes significant amount of time to launch one fleet
so you need to maintain some kind of pool inadvance to meet the demands realtime
I've actually used digitalocean for years for webhosting and they're cheap and great, was planning to try and use them first myself, fwiw
@south ether they are damm fast and boot up linux within 20 secs
Hey guys, so when a client connected to the game he is forced off and this is the error shown in the log; Error: FBitWriter overflowed! what is this?
guys a multiplayer game supports particle collisions? https://discordapp.com/channels/187217643009212416/375020523240816640/655915642167230505
Is there a NetMulticast that only sends to works on nearby clients?
sends to works?
whats that
oh, i was wondering what that means
as is, i can only guess that you want the multicast to affect players closeby
yeah
it does that by default, it won't execute on clients that its not net relevant for
default range is 15000 UU
ok good to know, that's what I thought it did initially before I actually saw the documentation, misleading.
hey all, asking here and in #cinematics , does anyone have any idea why a level sequence wouldn't play on a client, despite having ReplicatedPlayback on?
I Swear I need this 
we all do.
my old (udk3) programming text book even said to burn the chapter after reading
LogNetPlayerMovement: Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?) Anyone else received with after upgrading to 4.24? It comes with inaccurate positioning of my character.
after unpossesing AI controller and destroying pawn. AI controller is still in the world
how to properly destroy ai controller?
yeah emulation 😄
Hey, does COND_InitialOnly dynamically decide what to send on the initial bunch depending on the amount of data requested? Because I have a bug where an initial only variable fails to properly send itself to players if the server has 40+ connections
Is there a way to mark a property in a FFastArraySerializerItem as UPROPERTY() but stop it from being serialized on replication? just want to expose it to the blueprints
UPROPERTY(NotReplicated) is that valid? Found it in the list of specifiers
If I'm making a game that's most likely mostly listen server, how much latency should I take into account?
@solar stirrup it is
thanks!
i don't think that exposing a ffastarrayserializeritem in blueprints is a good idea tho
mainly because it will be pretty awkward to work with
better to add helper functions to the class the fastarray is a member of
it is a struct inside an array inside of a struct, BPs make that very awkward
@median marten Anywhere up to 200ms is good testing grounds
I've seen listen server games with more though since the devs didn't implement a limit
so two people who are matchmaking across the world at very far distances get matched
I don't think any game really holds up in those conditions
with player hosted servers across the world, people regularly play at 150+ms
Yep and often with quite poor connections / dropping packets due to the host
But it's still the most cost effective / simplest way to do MP
And I quite like how elegant it is in the sense it scales infinitely as the players host
if you restrict to regions then you wont be having people with 100+ ping
Yes it's a simple ping check and then it should be fine when matchmaking
and then people will be complaining they can't play with their friends from the other side of the world
I'd disable it for parties
Or private matches
But keep it on for matchmaking
Or just have a player defined value
Like CSGO does
run for the east coast, west coast, west eu, east eu, west asia, east asia, australia all separate, then you wont get anywhere close to 100 ping for any player
But also depending on your game and time, there may be no players around and it can be better for 100+ms and find a game than not find a game of course
But yeah if there's a healthy playerbase that would work great
Start with low ping searches and build up
im talking mmo servers restricted to specific regions
you wanna play at night, you wont meet anyone
Ah I'm talking listen servers for short session based play
I can't get my steam server to show up in the Internet tab of the steam master server although the game server API initializes successfully, there are no errors in the logs and I have set my steamwork settings for dedicated servers and also the unreal settings for the steam product name etc. Any ideas?
same machine running server and looking for it?
no, different machines
there is a weird line in the verbose log, it initializes the STEAM subsystem but after loading the map it initializes the NULL subsystem as well, is this supposed to be happening?
virtual void GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const override; I need to override this inside the UObject then
you also need to override ReplicateSubobjects in its Outer (i suggest actor because of unreal's replication glitch)
and add the callback for ACharacter class to update
where if a Component is Outer on Server, after the UObject replicates, its Outer will be Component->GetOwner()
(on Clients)
also IsSupportedForNetworking in the UObject itself
bool ReplicateSubobjects(class UActorChannel* Channel, class FOutBunch* Bunch, FReplicationFlags* RepFlags) override;
GAS has few examples for AttributeSet you can steal from
Now after giving a thought I dont' want the whole UObject to replicate
only few fields of UObject needs to replicate
If I use ReplicateSubobjects function to add ubject, doesn't my whole uobject wiil replicate
yeah, but that isn't much ontop of your replicated properties
^
thats how attribute sets replicate
you do need to be careful to stick them into UPROPERTY client side tho
can I explain my code design?
i honestly don't see a easy way to replicate specific properties inside a object from an external object
cause of the way DOREPLIFETIME macros work
might be better having a struct on the Actor and having the object set the stuff on that, and replicating that 🤷
AbilityInterface{
SetAbilityCompnent(UAbilitySystemComponent)
SetCharacterLevel()
GetActiveAbilitiesWithItemSlot()
}
AbilityImpl -> implements AbilityInterface {
//implements all functions.
}
CharacterClass{
AbilityInterface = Cast(AbilityImpl);
AbilityInterface.SetAbilityCompnent(CreateAbilityComponent)
//And use AbilityInterface for all ability related stuff like activating and deactivating.
//Use AbilityInterface for GetActiveAbilitiesWithItemSlot, GetCooldownRemainingForTag, etc from ActionRPG
}
This is my design
Is this design worth ?
and my replicated properties will exist in AbilityImpl
@winged badger used 3 backticks
much better
so what about my design
what exactly manages the lifetime of AbilityComponent there?
AbilityComponent will be created inside character and passed to Impl
you can't instantiate an interface object
I m typecasting it
and the interface can't hold references on its own
and its working
what exactly is implementing that interface?
{
return NewObject<UHeroAbilityImpl>(GetTransientPackage(), NAME_None);
}```
Hello guys! I'm new in multiplayer, so this question might be dumb)
Currently i have an actor with moving parts on server.
All movement is implemented inside components and can be triggered by public functions like
UFUNCTION(BlueprintCallable)
void MoveArrow(float RelativeSpeed);
And a bunch of defaultPawn based actors as clients.
What is the quick/best way to make actor with moving parts being controlable by all clients?
so why not a full component, why reinstantiate it all the time?
i didn't understand
and outer is important, GetTransientPackage() is not ideal for runtime
UHeroAbilityImpl::Get()
no I always have this```IHeroAbilityInterface* HeroAbility;
and every time you call a Get() it creates a new one
I call it only once inside character constructor
i am kinda confused at what you hacking GAS to achieve
I want to separate my GAS logic from character class
should definitely not be called Get() with that functionality, Create() would be much better
@winged badger makes sense
your custom AbilitySystemComponent should handle stuff like Getting cooldown times etc
and even if you go with this structure, making that HeroAbilityImpl a UActorComponent works far better then UObject
as it saves you a ton of headache down the line
@winged badger nice advice
honestly tho, you have a custom a abilitysystem component, which can have ALL this logic in it
already replicated
@meager spade but there are few things which my AbilityComponent can';t handle inside it
like what?
consider ActinRPG example, /** Returns total time and remaining time for cooldown tags. Returns false if no active cooldowns found */ UFUNCTION(BlueprintCallable, Category = "Abilities") bool GetCooldownRemainingForTag(FGameplayTagContainer CooldownTags, float& TimeRemaining, float& CooldownDuration);
so all these small things I want to separate
i honestly feel like you are making more work, when you have what you need already
i understand a custom interface, i have one too, but mine is for the Abilitysystem to do specific stuff on my avatar actor
not my avatar actor to do stuff in the ASC
I get it what you are saying.
i have a few helper functions in abilities like GetKaosASC (also a static aswell) and i can activate custom things, like GetCooldownRemainingForTag
my custom interface does return a KaosASC which is useful
just a cast of GetAbilitySystemComponent()
this is also cool
i am just giving ideas, whatever way you decide your choice
but AbilitySystemComponent is already replicated, and makes sense for all ASC/ability interaction stuff
here my main concern is abstraction
if i have to change something, I should not change my character class
If i separate things via interface, I only to change the implementors thats it
If i have interface then I can couple that interface with other implementor
well depends what kind of stuff your talking about, but i would def think twice about creating an object/another actor component for logic that can be in your custom ASC
ASC/Ability logic should be generic
not dependant on the avatar/asc owner
which is why i have a interface
for stuff which i need additionals for
if cast fails, then obvs that actor doesnt care for that
makes sense
@stark spear Please follow UE4 network compendium first. I think you need to setup PlayerController
@rich ridge got it, thanks!
@winged badger If outer is important then what should i use for GetTransientPackage()
{
return NewObject<UHeroAbilityImpl>(World, TEXT("UHeroAbilityImpl"));
}``` this should be fine ---> Not fine giving crash
@lean hornet Your tutorial is doing a lot of weird things tbh. I'm happy to tell you what you could/should do different.
I have a replication graph question. How are you supposed to handle weapons that the player can pickup / drop? I am currently adding them to the actor's dependent actor list when equipped and removing them when unequipped but that causes the weapon to be immediately destroyed when dropped. Should I spawn them again as independent spatialize_static objects on the dropped location instead?
@grizzled stirrup oh man thanks. That's gonna be quite a pain to take into account
@rich ridge whatever controls the lifetime of that UObject is preferable
Character in this case
Guys ever since I started using the OnlineSteamSubsystem I cannot connect to my dedicated server with my brothers at home. I get this error in the server terminal when they try to connectPreLogin failure: incompatible_unique_net_id
@winged badger so yesterday I was passing the world context and it was crashing, will try your way and see the results
Multiplayer Procedural Games Like Star Citizen. The World Is Huge, and obviosly it's too big to be stored, all at once. So. If your far away from the planet, you, as a client would render the planet as a sphere. and than as you go down, You render it as terrain with buildings, and collisions etc. However for a multiplayer server. Wouldn't the server have to keep the entire games collision Avaiable at once, Like A Server Couldn't have LOD just incase a player was to fly down to the planet and expect some server sided collisions. If the server keeps track of everything, wouldn't this slow it down a lot?
- why did you capitalize random words
- if the goal is to run the entire world on a single server, this can be solved by diving the world into sections/chunks of some kind and streaming the ones that players are near or generating them on demand
Hi, is AGameModeBase::Logout(AController* ) exactly opposite of AGameModeBase::PostLogin(APlayerController* )?
Yeah, but why this function takes a Controller pointer as a argument?
Anyway it casts to the a player controller..
@fleet raven there is a high chance that all the chunks are loaded into the memory.
For example sever can have players and each requesting different areas, and that will end up loading the entire chunk
It's a pretty simple concept on paper... Lower the player count or lower the relevant area size per player until "not" all world chunks need to be loaded. Continue doing so until memory usage is acceptable 🤡
@hoary lark what if lower player count and each chunk has one or two players
It's simple if you ignore few edge cases
Tricky indeed.
I still remember Epic dev said they are hoping the players are all spread out in Fortnite.
Guess this is something has to do with chunk in multiplayer
I think you should not consider Epic's approach towards this. They can afford high end computer machine to run the entire map
For small devs like us we can afford that kind of machine
If they would have chunked their fortnite map, then they would have definitely released a blog about that
Their own computer? Wait i could be mistaken something here.
Like AWS
Oh i thought you literally mean their own office machine
No bro
If I had to solve this problem, I will setup my chunk of map a bit largers and make it a streamable map. And the number of dedicated serves is the number of streamable map.
The original topic talked about StarCitizen here. Still nothing about Star Citizen's multiplayer is stable. Players still lag and randomly ragdoll crash in the level and space. This is what i saw on the recent youtuber video.
So each map = different server?
I see.
But again you need a master server which keep tracks of all these transactions
However this won't be nice for those who wants PvP or PK enabled. Exploit is very common in most MMO as seen over the years
Save it and load from db
If you consider PvP,then there are two possible scenarios
- Both player are on same map -> so only one map is loaded
- both players are on different map -> two servers are loaded
Meaning the players interact with each other on different map. Typo right?
Oh ok saw.
Not easy to have 2 servers talking to each other doing damage.
Depends on kind of game.
Which is why there is no solution yet.
And the same exploit still running in today's MMO
If two players are on different map meaning they are too far from each other, they can't damage each other by any means
Um sure but what about the borderline?
Yes that's again a tricky situation
I think we have to have a upper hand here and should not allow fighting at border
The moment your target instanced to the other map. Chances are you may not see that person again. Or you get camped while you load your screen and map. Or it can be battle of hardware attrition. The one with best SSD wins.
Most of the cloud providers they have good SSD, that should not be a concern here
The other alternative is the player exploit it by running back and forth on the borderline.
Any ways a developer it's your responsibility.to sync all the clients
Not that easy. The right way of PvP enabled multiplayer should never have instance server
U mean for PvP it should be listen server
But i am interested to hear about the chunk answer from them or others. Guess it is sleeping timezone for most people here
Well, either way i wouldn't try to make any zones loading for PvP type of multiplayer still.
Bad idea tbh
tbh?
To be honest.
You seem to be looking for something like SpatialOS which connects multiple unreal engine servers together "seamlessly" with a bit of work on your end.
https://improbable.io/spatialos
Lol my english isn't good. Sorry about it
Note that it is still in alpha and not a completely perfect solution
@random sundial i noticed. The staff said it is not able to run 1,000 players for Unreal Engine on their discord not long ago. I can find the said message in their discord.
They said it is only 30-60 players for Unreal Engine at the moment.
Not even lying. I can find it if you want
Wait
Yeah, it is in alpha and moving slowly. I don't think they actually have the whole multi server thing fully implemented for Unreal engine
If you check their roadmap it says it is coming in 2020 sometime. https://github.com/spatialos/UnrealGDK/projects/1
Not the best if you want to release an MMO today
@sacred spire so you are saying PuBg and fortnite doesn't use single server
@random sundial it's even more costlier than AWS or AZURE,
They themselves say it
Pubg and Fortnite use a single server, they are just really well optimizied and pubg uses a custom engine version.
Every large game uses a custom engine really
Fortnite is where UE4 is made, we get the features 6 months later when they're working okay
I truly believe whatever tech which fortnite uses is available on public release of UE4
@rich ridge yup. You need your custom solution to run PUBG or Fortnite.
Some of the Fortnite tech trickles down to the main engine
Doesn't all of it? Most of the tech just lacks documentation
Certainly not all of it no
Not everything made for a game is relevant for all games
Epic has always used a custom engine fork for every single game, even the community UT thing. They never use the main engine branch
@bitter oriole because we can't use those features in well optimized way
Exactly.
If you are thinking of running 100+ players like PUBG or Fortnite, you gotta spend a lot more time.
@bitter oriole I know that but they do merger those features to main engine
If you're thinking of runing 100+ players you're probably deluded, no offense.
^exactly.
Or much better funded that I am.
Tell me your worth. Now.
😂
Basically 100 online players is like 5% of Steam games now, so you gotta be really confident about selling more than most other titles
Hey its simple. Just make a kickstarter and promise everything. Then release a beta and live of that
That won't cut it today
Yeah like most multiplayer does that
Um not really
Take a look at Oath and Day of Dragons
Scum and DM managed as well
But they are very few in numbers
Oath and Day of Dragons are dumpster fire. The latter is funded with $550,000
Oath literally scammed people over 6 digits of money.
Their discord currently full of shit talk and hate sadly.
550k is not much
If you can earn that in a month, sure.
It's not enough to make any real game professionally
Yeah, you really want to be the next Star Citizen
The point is, getting the money.
Not about much or not. They probably don't even release beyond beta or use much of the funds
The problem with Kickstarter is that asking for the real amount (5, 10, 20M) kills your campaign
So people ask for 10k, still needing 5, 10, 20M
They got 500k, what do they do ?
Well yeah
Buy a small yacht?
Nah buy a yacht like grim said
Anyway, some data on Steam player counts :
- 1% have 500 players or more
- 3% have 100 players or more
- 5% have 50 players or more
- 10% have 15 players or more
Those are some depressing stats
Where do you see that?
Play around with Steamcharts for a bit.
It is indeed not easy to make multiplayer
1/10 don't recommend
I am not on PC to open steam. I never remember where to find that.
Basically if you needs your game to have 10 players around, you need to be a really solid title
If you need 50 players you are setting yourself up for failure
Would be nice if you can screen shot if it is a list displayed straight away
My suggestion is also building up a community before the game releases. Make sure it has some traction beforehand, will help with publishing etc.
Discord is kinda nice for that
You can also gauge whether anybody will care when it does eventually release.
Yup. Going 50players is hurdle. Not only that, the real issue is finding 50players at once.
Being able to iterate and improve on an MP game is now stupidly critical as well
50 players, worldwide, playing at the same time, is impossible for 95% of games. Not even talking ping, servers, etc.
The big-leagues are pumping content out so fast now people expect it for everything.
If you are college student they explore your campus for players
Just bribe college students, they will play your game
Remember when Read Dead Redemption 2 tanked its publisher's stock ?
Huge volume, critical success
But "not the next Fortnite"
@bitter oriole i am on mobile browser Steamchart. I cannot find anything to allow me check what games have what number players in their multiplayer.
An ongoing analysis of Steam's player numbers, seeing what's been played the most.
This is page 50 of the top played games
1226th most played game (so, borderline top 4%) has 59 online players
So if your game needs 59 online players worldwide, today, you'd need to be in the top 4% most played games on Steam
Current players but most of them are singleplayer though
Doesn't change anything, though
Have you played this game
Uh. I thought you originally meant to say how many multiplayers have what type of number of multiplayer "arena"
What I mean is very simple : if you plan on having 100 players available at the same time, near eachother, you need to be in the very top of the most played games
I see. I understood the other way round.
95% of all Steam games could not work as multiplayer arena games because they'd be player-starved
So, like, avoid doing that 😛
Exactly. Every games are competing for players and time
Unless you think your game is really next Fortnite, maybe you can go ahead and build large scale multiplayer game
I think MOBA is good to go
Even for a 5v5 MOBA, you need to perform drastically better commercially than the average game
@sacred spire but only 10 players at a time
Correct 10players. But would you want only 10 hero option as MOBA while the top MOBA has more variety?
It is what you can offer what other MOBA or Fortnite cannot offer. If you have same thing or not much of changes, then best to go back to singleplayer.
10 players MOBA with 15 minute games with one minute matchmaking (too long) and only three matchmaking regions means you need 500 players
Welcome to the top 1% selling Steam games
Can't do that ? Your game is dead
@bitter oriole even fortnite takes 40 second for matchmaking
I have experienced even 120 seconds with fortnite
@bitter oriole was this the reason why Paragon shut down?
Ohk, means Paragon had some good number game audiences or players despite that they shut it down
is it possible to start dedicated server .exe with network profile enabled?
i know that i can run networkprofile enabled in editor
is it possible to start .exe with that argument
thnx
Anyone else noticining significant drop in network performance on 4.24?
Anyone knows how can start the implementation of STUN and ICE for a peer to peer mobile game?
@rich ridge There is no information about this. But I'm pretty sure that if Paragon would have been worth it, Epic would've kept it.
So based on that I would say: No, it didn't do well enough and didn't have enough players.
@real yacht I think Epic added some stuff that allows profiling a server. But not sure how. It might be done by joining the server.
The server would then report the stuff to the client. At least that's what I think it was. They made this during the time they had Fornite and Paragon to be able to debug and profile cloud servers iirc.
Is there a way to use servertravel command with absolute? Like opening a new level? what would the command be?
how can I use this in execute console command?
with the open level node there is also an options string you can input, maybe there is a command for that?
Hey guys, do you know any information source, on how to implement online matchmaking on android? thanks in advance yum
Trying to get an instanced mesh to delete for everyone. Currently it will delete on the server's version and not on any client, regardless of who has attempted to delete the instanced mesh. Here's some code from the player controller..
and here's blueprints from the instanced mesh actor. It's set to replicate as is the instanced component.
Here's some code from the player controller..
clients wont have the other player controllers
the multicast will be called on their player controllers right
GameState is good class to use replicated variables though over all network
Or keeping all player controller informations on GameMode class which is available only server. You can add/remove player controllers using Event PostLogin or LogOut BP events.
But I'm calling a server event on the controller to then call a multicast event on a server object?
yes, but a multicast need to be on something that exists on client, where it will execute the code
thats why u cant multicast from gamemode for example
even though it exists on server
But the actor that I'm calling the multicast on already exists on the clients
youre calling on what actor?
So basically the controller uses a run on server event to then tell an actor to multicast its instance being removed
maybe it could be a authority problem which causes to destroy unauthorized actor instance
also UMG widgets
But Takain, a controller can still pass a message to an actor for that actor to multicast it??
Or am I getting confused?
(I havent made anything in multiplayer in a loooooong time)
aah
the multicast is not on the controller
k, i tough both the blueprints were inside the controller
sorry
No sir, that multicast is on the actor that I want to remove the instance from
np np ❤️
I'm just confused as to why this doesnt work - I'm pretty sure it should work just fine.
are u sure the index is the same on all clients?
or better, are u sure its not calling that at all
Are these variables needs to be replicated?
If I put a print string after the RemoveInstance, it'll return true for both the client and server
I'm pretty sure the indexs are the same, seems that way since they're made on the server.
The actor is replicated, as is its component
@icy nacelle Are you inside of a PlayerController?
For the first screenshot, yes
And the BP_HISM_Brick is replicated?
yep
Hm, not solving the issue, but you should add a branch to make sure the hit was actually blocking and an IsValid to make sure the actor is valid.
Does that Multicast call everywhere? Did you print something in addition to the RemoveInstance call?
Yeah I'll add a branch later, just wanted to have this as a test then move it to an equipable item.
The multicast does call everywhere, and I put a print string at the end of the remove instance return value and its valid on clients/servers even though it only removes for the server.
I'm starting to think that maybe its to do with the HISM not being replicatable?
The HISM won't be replicated, but you are passing the Replicated Actor, so that shouldn't matter.
The more important thing is: Is that Index the same on everyone?
I believe so, even when working with just one mesh in the scene it should still always work, right?
Not sure what you mean.
The Index indentifies an instance of a mesh in the components array.
ah, I have an idea of how to test this
If you do it like this ,then you need to make sure that every player created them in the same order.
I got client1 to place down 5 bricks and printed the indexs when an instance was added
Not sure why the client pinged off twice?
Not sure either, it's your code
Figure out why the placing fails
Then you can come back to the removing
But the placing isnt failing, its just printing out the index twice on the client
@rich ridge first sorry for the late respons.second im making my own dedicated server and building ue4 from source and i'm following the github tutorial and when i get to the part(when you download the engine and its all set up you go to source and copy and paste a file and rename it to server.. and replace the text with the one from the tutorial but its out of date) im looking for that code for ue4 2.24version
DM me for faster respons
The latest version mentioned is 4.19 I believe, so that same version will work for latest version
Why would this be happening?
Actor is set to replicated, and client spawns using server > multicast
It seems like it spawns two of them
Quick question about switch has authority. I used to think that authority would ALWAYS refer to the server. However, it seems that authority refers to the owning client when inside of the player character. Can someone explain this? How am I supposed to spawn the player weapons on the server if switch has authority doesn't refer to the server version of the player's character?
i think there is a better answer out there but I restrict some actions to the (dedicated) server using if (GetNetMode() == NM_DedicatedServer){}
I can't for the life of me figure out how to call this event and make it replicate. Any ideas? I've tried everything I know. https://i.gyazo.com/dad312f32d31838c8312fcedbbf681b1.png
@icy nacelle how are you creating the instances?
Almost the same way I'm removing them. The player controller calls a 'server place brick' event, which then goes to the manager class on the server. The manager class checks if it needs to create a new instance, or a new actor + instance, then creates one.
and the ones that are pre-placed?
and the server replicates what exactly HISM related?
This is just used to figure out if we need to make a new instance or make a new actor then instance on that
The server basically just needs to create the brick for everybody
This is then related to if the actor is either spawned or if an instance is just added to it.
Am I making sense? Its been a couple years since I've delved into multiplayer.
why do PlaceBrichMulti events not have the same number of pins on 1st and 2nd screnshot?
That is a structure that has been split
which part isn't working then?
So the part that isnt working isnt these screenshots. These screenshots are the code for placing down the brick.
The part I'm failing to get working on multiplayer is removing the bricks.
Which is this:
does it remove the wrong instance or none?
Which is even simpler, but it doesnt seem to work for clients, just the server.
It'll even return true
Nope, wont remove any instances on the client, even if its the client deleting it - it'll just delete it on the servers version lol
BUT, when either the client or server deletes a brick, it'll return true on that string.
btw, there is no need to RPC the reference to BrickManager on first screen ontop
server can use its own, its good
Ah, for placing down a brick?
Doesnt look like it
[2019.12.17-22.50.56:763][956]LogBlueprintUserMessages: [BP_HISM_Brick_C_0] Server: true
[2019.12.17-22.50.56:764][956]LogBlueprintUserMessages: [BP_HISM_Brick_C_1] Client 1: true
no "accessed none" entries?
no sir
I've tried everything I can think of to debug it
I can only find one person struggling with removing instances online and I'm not sure if that issue is even related.
can you print number of instances you have in the HISM
after you add it?
*after you add an instance
Nah mate, delta sections into duration is all gucci
So I just added two instances with a client - the server listed them as two.
Then I deleted one on the client, the server said there was one instance.
I deleted the second one and the server says its one.
Could this be an issue with the client not updating the array of index's?
im more curious if client ends up spawning 2 instances in the same place
ah
actually.. there was something that might point to this issue
so remember when I said when I place the first brick down, it'll decide whether to spawn the actor then throw an instance in there?
well when I put down the first block, it prints out twice for the client.....
So am I missing an all-important 'SwitchHasAuthority' somewhere?
you didn't make the brick actor replicated, did you?
BP_HISM_Brick is for sure replicated 😛
and that would be your problem
hm?
So it shouldnt be replicated?
it can either be replicate and not be spawned separately on the client
or it can not replicate in which case something else has to handle those multicasts
Right, so I'd rather it only be spawned on the server
So to my issue is that I'm spawning it twice for the client?
spawned separately at runtime makes the not replicate version little difficult to handle from BP
as you can't get the NetAddressing working
put authority check before spawnactor<brick> call
and hope thats the only problem you have 😄
like so?
ah
just can't spawn replicated actors
whats there to be confused about
don't spawn any actors from clients inside multicasts
i'm confused as to where I need to do an authority check
how many spawnactorfromclass nodes have you pasted here?
This is the only one I use.
Is this the correct place for the auth check?
\o/
Okay so it looks like that just stops it spawning for the client. HOWEVER, I have placed one in the player controller and I think it's solved the issue of two of actor spawning multiple times. It does look like there is another issue though, and I don't want to waste your time further so I'm going to dive into this new issue and see what's what. Thanks for your support so far, this is very frustrating and you've made it a lot easier to understand ❤️
Oh wait, no it hasnt. Oh well, I'll still dig on!
now you are no longer spawning it on client
you have to teach it to register with brick manager
as it won't be added to that map
client side
@icy nacelle If I am not mistaken, then on the server and clients different indexes. It kind of depends on the level loading order.
They're the same indexs, I've tested it out
they are all spawned at runtime, so thats not the problem here
Plus they're not being loaded, I'm placing them in the level on runtime
hmmmm
I cannot get my head around this issue
I triggered the Multicast event in which I forced all clients to delete the tree in the position that was on the server.
No matter what I do when i spawn an actor on a server from the client it always spawns two of them when I multicast. i tried excluding the client with a reference to self, then it spawns none on the client. how do you properly spawns things from a client character
how about the client calls a server rpc, and the server rpc calls the multicast(spawn) function? I think that should work
if the spawned actor is itself replicated, you'd end up with 2 on clients using that
Hi everyone,
I am sitting in a Starbucks with WiFi.
Want to package my little mp Unreal game and create a listening server on my own machine.
Invite a friend in the same city but not in Starbucks to join session and spawn his character
into match / session.
I checked and I have several different IP address and not sure which one to have him type into
an editable text box on the main menu screen to join my session. That will fire off a console
command to have his game join me.
This is what I see on my Windows 10 laptop:
Your public IP address XX.XXX.XXX.XXX
Link-local IPv6 address: XXXX::XXXX:XXXX:XXXX:XXXXXXX
IPv4 address: XXX.XX.XX.XXX
IPv4 servers: XXX.XX.XXX.XXX
YYY.YY.YYY.YYY
Can you guys tell me which IP address would be most likely to work if any?
Thank you !!!
none of them
without a service doing NAT punchthrough, you'd need to port foward a port on the starbuck's router to your laptop
and the public IP of that starbuck's router
if your friend is at home, he/she can host
Oh really?
setup port forwarding and give you his/hers public IP
Oh that is cool
because the starbucks router will expect an answer from his IP after you send a packet to it
So my friend hosts at home and then sends me his IP address?
so it will let it through
he will need to port forward the Port you're using to his local IP address on his router first
then it will work
yes
every router is different, but its login to it from local network with an admin password
find port forwarding menu
enter the port and public ip of the computer you're forwarding the port to
and hit apply
no, his local IpV4
The one I have in SB
port forwarding works on the scope of his home network
yes
All I have to do is send him my IP address?
Oh I see
ok got it
TY
slap 🙂
o.k. cool so he has to know his public IP and then send that to me
Then he has to do posrt forwarding
So its 2 issues?
yep
o.k. so he can just google to see his IP right?
first one is easily solved by googling whatsmyip
right
bingo
ok so the only sticky point is the port forwarding?
I will have to explain that to him
Thanks for that 🙂
@winged badger So what if I can just have two friends with residential WIFI or internet test it for me? Is it a simple matter of them sending each other their IP addresses or will they have to forward their ports too in that scenario ? TY
only the host needs ports forwardewd
not without nat punchthrough
like running your game over steam sockets
for which you need a SteamID
Yeah but that is a $100 right?
To join Steamworks?
Set Up Port Forwarding
Log in to your router as admin. ...
Locate the port forwarding options. ...
Type the port number or port range that you want to forward. ...
Pick the protocol, either TCP or UDP. ...
Type the static IP address you've decided on. ...
Enable the port forwarding rule with an Enable or On option.
I Googled it
So now if the host wants several friends to join how does he forward his ports to different IP address for the same session?
Can you forward to more than one IP?
anyone had the issue when you spawn a physics actor it is invisible until the client moves it?
I didn't do it I promise 🙂
Hello Guys,
Is there any menu in AWS console to show how many hours of my free tier remaining in current month?
@wet oriole in free tier it's free for whole month,.don't worry
Means 30*24 hours you can run
As long as you aren't running multiple instances concurrently you should be fine for the whole month. They give out like 730 hours iirc
Hi, I have this peculiar problem: From time to time when calling server travel, one or more clients will travel incorrectly, and they initialization dependent on GameStateBase BeginPlay is broken, GetGameState will return null, even with delay.
Every controller calls "PlayerController::ClientTravelInternal_Implementation", "World::SeamlessTravel", "SeamlessTravelHandler::StartTravel", will bring untitled dummy world, then "SeamlessTravelHandler::StartLoadingDestination", as expected.
In correct case, after seamless travel is finished, GameStateBase::On_RepHasBegunPlay is called and everything works as expected.
However sometimes "GameStateBase::On_RepHasBegunPlay", then "GameStateBase::BeginPlay", will be called before travel is finished (!)
This case is always accompanied with warning in "UActorChannel::ProcessBunch" and 'GetObjectFromNetGUID: Attempt to reassign read-only guid'.
Delaying 'Context.SeamlessTravelHandler.Tick()' in "UEngine::TickWorldTravel" by a small arbitrary time did help, but this is hack, not a solution.
Did anyone have simmilar problem and/or knows solution/culprit? Used version is UE 4.22.3 built from source.
QA is testing the game with clumsy software, settings are: enabled throttling with Timeframe(ms) : 500 and chance : 100%, is this solvable in ue4?
if packets are blocked from client side and sent in one batch, how can i deal with that, because if i have some RPC (pickupArmor), it will not happend, because of throttling
and i'm not sure how can this be solved? thnx
Don't use RPC's for the 'state' of the game. Otherwise if it gets dropped you can't recover.
@thick sleet You can't guarantee the arrival order of actors at any time, even match start-up or after travelling. Game State might be received even later than the players' pawn. You have to code around it.
Using delays to get around ordering issues is a really bad way to try and "fix" the issue, since it's not really a fix at all.
So if i need to change armor to be visible on all clients, what should i do? If i pickup armor on server it need to be RPC
Well it's a very game-specific question but the armour should have a replicated variable about whether it's visible or not
If you change the state of objects using RPC's, then lot's of things are never going to work - such as join-in-progress for example.
Understand, but how to deal than with that kind of problem?
Redesign the code
Use replicated variables for object state, not RPC's telling clients to change states.
RPC's are for one-time events that need to happen there-and-then. If a client joins a server, they shouldn't need to care about any RPC's that happened before they joined.
Well, whatever really
Notify or not
Understand
@chrome bay I use no RPCs during initialization and arbitrary delays are evil. Issue is that GameStateBase on Client gets On_RepHasBegunPlay before seamless travel is finished. This happens only in certain (small) maps. What causes that in normal case On_RepHasBegunPlay is called only after travel is finished? Is execution of ProcessBunch paused or buffered?
What is On_RepHasBegunPlay - something you've created?
Sorry, ment OnRep_ReplicatedHasBegunPlay and it is function in GameStateBase.cpp that will call NotifyBeginPlay and NotifyMatchStarted on WorldSettings. It is default part of engine code.
Hmm these kinds of things aren't easy to debug at the best of times. I mean if the gamestate is received by the client with bReplicatedHasBegunPlay = true already, then the OnRep event will fire immediately after the actor is created (as part of ProcessBunch)
(ProcessBunch is not blocked during travel though, to answer that question).
is it possible to have some control over the order the client handles new information it receives?
im having a spawned actor and a replicated variable from a different object arriving at the same time, but i want the OnRep function from that variable to run before BeginPlay on that actor
Not possible, you have to code around it
I'm trying to build a Linux Dedicated server and the cooked build is around 10 gbs. Most of it is the Content folder. The project has a lot of art assets, but I'd assume the server doesn't need them? So is there a way for me to tell UAT to strip the things the server doesn't need?
This is the build command:
..\..\Engine\Build\BatchFiles\RunUAT.bat `
-ScriptsForProject="C:\sd\dev\$ProjectName\$ProjectName.uproject" `
BuildCookRun `
-project="C:\sd\dev\$ProjectName\$ProjectName.uproject" `
-nocompileeditor `
-noP4 `
-map=Sunrise+SpringCounty+MainMenu `
-clientconfig=Development `
-serverconfig=Development `
-serverplatform=Linux `
-targetplatform=Linux `
-compressed `
-cook `
-stage `
-package `
-prereqs `
-build `
-utf8output `
-compile `
-unversionedcookedcontent `
-SkipCookingEditorContent `
-unversioned
The server needs the assets
All of them? Even the ones that aren't used in the level?
Mesh data in particular is obviously required for collision, level data is required, metadata for every single asset might potentially be required so UE4 does not strip anything
Assets that are not used in any levels will not be packaged if you set your project up correctly
if you set up a list of maps to cook in project settings, only used assets are packaged
Isn't that the same as -map=Sunrise+SpringCounty+MainMenu ?
It needs to be in the packaging settings.
I'm pretty sure the command line map list is ignored
we are using -map=MAP_1+MAP_2.... etc but yes, you need to add in packaging settings all maps
Not "all maps", mind you, but the list of maps
all maps = all that you need 😄
= all assets used or not
so yes, list of maps to inclued in packaged build
Thanks, I'll double check that
hi.
Someone knows how to contact a Stun/turn server from c++? im looking how to implement peer to peer connection
Hey all,
I got need a wait for players at the beginning of a match so that all start at the same time. I tried several ways to do this but either the clients call the set players ready int multiple times (when i did a multicast in the beginning) or running it on the server wich got the number of players right but failed on setting the player variables and widget... here some pictures of my recent try
Character begin play
Game State counting players and trigering n event on all clients
character bp
Play mode
If I make a Linux server can users on windows join it?
@hazy herald yes
in fact, if you are doing any hosting I recommend it, for a variety of reasons.
So whenever clients connecto the the game they spawn alright but they can't move
Only jump
It's like their on 1100 ping (Fortnite reference)
@plush saddle thanks I plan on using my own physical server to host for now unless my game gains a lot of users
Hey guys, how are you? I need a bit of help with some LineTrace on multiplayer.
I'm making a "pickup" part of my game and, after searching a little bit, found a tutorial using LineTrace both on client and the server. The client part works flawlessly, but the server part doesnt work.
Here's the code:
void ARunicWorldCharacter::Interact()
{
FVector Start = GetMesh()->GetBoneLocation(FName("head"));
FVector End = Start + FirstPersonCamera->GetForwardVector() * 170.f;
FHitResult HitResult = LineTraceComp->LineTraceSingle(Start, End, true);
if (AActor* Actor = HitResult.GetActor())
{
UE_LOG(LogTemp, Warning, TEXT("HIT ACTOR %s"), *Actor->GetName());
if (APickups* Pickup = Cast<APickups>(Actor))
{
UE_LOG(LogTemp, Warning, TEXT("ACTOR IS A PICKUP"));
ServerInteract(*Actor);
}
}
}
bool ARunicWorldCharacter::ServerInteract_Validate(AActor* Actor)
{
return true;
}
void ARunicWorldCharacter::ServerInteract_Implementation(AActor* Actor)
{
if (GetLocalRole() == ROLE_Authority)
{
FVector Start = GetMesh()->GetBoneLocation(FName("head"));
FVector End = Start + FirstPersonCamera->GetForwardVector() * 170.f;
FHitResult HitResult = LineTraceComp->LineTraceSingle(Start, End);
/*
* TODO: Actor is breaking the code when called from the server
*/
UE_LOG(LogTemp, Warning, TEXT("VALIDATING ACTOR"));
if (AActor* Actor = HitResult.GetActor())
{
UE_LOG(LogTemp, Warning, TEXT("HIT ON SERVER %s"), *Actor->GetName());
if (APickups* Pickup = Cast<APickups>(Actor))
{
UE_LOG(LogTemp, Warning, TEXT("SERVER PICKUP"));
Pickup->UseItem(this);
}
}
}
}
If I play without Dedicated Server, it works. When I check the Dedicated Server option, I can't pickup anything.
Any help is more than appreciated. Thank you.