#multiplayer
1 messages Β· Page 613 of 1
Sorry for the stupid question but i don't get it so i'll try to simplify, what do i connect to the location on the teleport node in the overlap box?
you cast the otheractor to your character
thats why they have a common base
with shared API
anything else is kinda suicidal
Can you explain this point a bit more? I did make the other characters children of a base character
So there is a shared base and if i edit the base character blueprint they are all updated
you should go to #blueprint for that
im at work, and can't go into lengthy tutorials
Found a solution, thanks!
Hi, happy new year !! π
Does anyone have a solution to quit a replay without having to reload the game level?
I manage to record it, I manage to stop recording, I manage to play it but I can't find a way to exit and return to the game without relaoding the level.
I'm trying to build a sort of kill cam but for a multiplayer sports game. A system that allows you to review the goal that has just been scored.
Quick question, if I switch to using the ReplicationGraph, from what I'm understanding from videos and reading the source, I don't need to handle RPCs or code calls differently, correct? It seems like ReplicationGraph is isolated to relevancy and handled under the hood
Pretty much yes
Awesome, thank you for confirming π
Hah, indeed, the possession system would need to be simplified to an extent
but too much stuff going on in the background
well, its less quirky then 4.22 π
Yo! Question about shooting replication.
Pretty much, our game is a co-op game and we don't mind security against cheating. But we do value performance and experience. That said, how is your approach when it comes to replicating weapon shooting?
To be a little bit more specific, do you just signal the server a player is firing and handle the rest there? Do you expect the client to send the target of their shootings?
We're pursuing the most performant way to achieve that, and we simply don't care about cheating.
Fire the weapon locally, play effects, anticipate damage etc ; tell the server, and wait for it to confirm damage / ammo etc by replication
It's perfectly fine to send the aim vector to the server
Sending the result works too if you don't care about cheating but it's not really 'better'
Well, yes. Exchanging the result works for us. But what worries me it's like a shotgun. It casts several linetraces, and the bullets apply damage to several targets at once. Do you think sending all these targets over the network wouldn't stress it?
Yes it would
i optimized that by only sending the first shot, along with a seed
The aim vector is usually the preferred way
and having clients simulate
^ along with a seed for randomized weapons
Also, for automatic rifles. How do you approach that? Do you have events like StartFiring and StopFiring or do you submit a signal to your server every time the weapon shooting ticks?
That can be quite inaccurate, right?
And again, aim vector updated through unreliable RPC on tick
I'd have to predict stuff, right?
You will have to no matter what
Well... yes. But if I the client submits the targets to apply damage to, alongside with the damage, then I have greater accuracy 'for free', don't I?
Well it's not free for starters because you have to upload the damage data
Also, isn't submitting an actor to the server vs. a vector, more lightweight?
And it's not more accurate because desyncs happen and other players will see impossible stuff
The Actor submits a NetId IIRC, which is a byte
An integer per say
i actually follow how fortnite do weapon shooting
they produce the target data client send, send to server, and server multicasts the FX. Tho there is optimizations to do
they trust the client to some extent, server just does basic trace to make sure nothing blocked the shot that the client has not seen yet
Gotcha
Yes, in our case we can fully trust the client. But that comes with a cost: packet weight.
for a non competitive a game, you can get away with this. if its competitive, then you need some anti-cheat measures
but Epic would not disclose that to me π¦
i did, but they won't share anti-cheat protection stuff lol
yea i was kidding
but anyways - yes, i guess i got the material i wanted...
thank you guys π
the only thing i'm still unsure is
how do I predict stuff server-side?
they did tell me some of the basic checks, like yaw angle etc
@gloomy tiger i would look at GAS
the pinned messages has a GAS Shooter project, which is a nice thing to look at. Does things differently to how i would do it, but it works
So I am currently having a problem with getting the Steam overlay to show up on UE4(4.25.3). I turned on the Steam Plugin in editor along with adding the settings to DefaultEngine.ini file. Afterwards I packaged the project and made sure to have Steam was open when running the game, however I got nothing.
Then I tried to set it up with UE4(4.24.2) an older version I had following the same steps I did for the UE4(4.25.3) project and it worked...
I'm confused as to what changed between versions so I can get Steam overlay working with UE4(4.25.3) as I'm trying to make a networked game using Steam.
If anyone has any suggestions I'd be happy to hear
Steam_appid.txt or set the appid in the ini file as per the docs?
isn't that just the 480 id?
I am replicating montages and that is working. I am now trying to replicate projectiles that spawn based on the montage's notify. As of now, notifys are only handled on the server and when a specific notify triggers the spawning of the projectile, that should be happening server side. The projectile spawning includes creating a timer and then that timer calls the run on server and multicast events to actually spawn the projectile. Similar setup to what I have for the montages, but it is not working. Projectile is set to replicate.
@meager spade I believe when Fortnite first came out shooting was fully client authoritative, it was full of cheaters shooting through terrain π
they changed it very soon after that
Vehicles too
yeah, not sure if they changed it now
Haven't played it a very long time
they still use client side shooting
but have a lot more anti-cheat and stuff on the server
they can not shoot on server cause server does not update animations, so can not get reliable hit info https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1660211-gameplay-abilities-and-weapon-firing @signal lance
ah that's very interesting
If I understood it correctly any client side shot is sent to the server, verified and info sent back
That's sounds like whole lot of traffic and RPCs
I don't know, a common weapon implementation would be client-side fire -> send hit info to server -> server checks the shot and fires a client RPC to confirm damage (hit marker etc)
yeah don't really see any other way with client side weapons
with server authoritative client would only need to let the server know that it started firing
Yeah but which game actually does that ?
A client RPC seems inevitable to visually confirm hits
yeah
i send a ClientRPC back if the hit was successful on the server, client sees muzzle flash, etc, so he is firing real time. Only when client RPC comes back, does he get the hitmarker.
Yeah I think that's a very traditional design
Valorant does that for example, AFAIK
You see the hitmark much later with the latency
So I've all connected players in my game mode, how can I show that info on all players widgets.
you can loop through the players in the game state, which has an array of all the connected player states @summer tide
How do you guys combat wall hacks?
I read that Valorant does ray traces to turn replication on and off, but like, you're going to need multiple ray traces lol
At least 4 minimum I imagine
Someone else the other day was mentioning using "IsReplicationPaused"
But in terms of th e action code, and detecting it using ray traces, I'm not sure what you guys suggest
IsReplicationPausedForConnection If this returns false, does this mark the actor as "Not relevant"
bool bNewPaused = true;
for (const FNetViewer& NetViewer : NetViewers)
{
if (!Actor->IsReplicationPausedForConnection(NetViewer))
{
bNewPaused = false;
break;
}
}
const bool bOldPaused = IsReplicationPaused();
// We were paused and still are, don't do anything.
if (bOldPaused && bNewPaused)
{
return 0;
}```
looks like thats all it does
Did someone try to connect project with steam in any way?
steam sub or uworks or something else?
i reckon a lot of people have, considering a lot of UE4 games end up on steam
I've d one it before
Just read steam documentation
and import the dll files
from the sdk
thanks
You donβt need to import dll files on a listen server. I believe that is only necessary for dedicated.
@fading birch The game state has PlayerArray which returns all player states. Thanks i got it
Another question: So I have a list of all the connected player names on screen with speak icons next to them. So when a player press and release the key T, I want to toggle the icon as well.
How can I do that?
Is actor attachment replicated?
If I am not wrong if you multicast the attaching function you dont need to take care of the rest
I'm fairly certain it is if movement is replicated
Id rate myself about an 8/10 in BP and 2/10 in C++. Should I screw around with doing Steam on my own or just buy Steamcore?
Listen server only
see if UWorks is still available
no difference from SteamCore, but it doesn't cost as much
Hiya, is there any method included in CharacterMovementComponent that properly replicates rotation that's not AddControllerYawInput?
Or, make so that AddControllerYawInput doesn't rotate the camera as well?
Sorry if this is something that's asked on a daily basis but how do you show the correct names in the title bar of PIE windows for Server and clients?
@stoic acorn what you mean?
if its the title bar on windows and your on 4.26, it is a known bug
Got a bit of an irritating issue with packet order, not sure how to solve it. I have this code which spawns an actor and then RPCs to the client to tell it to pickup that actor. The issue is the spawned actor hasn't actually repped down to the clients yet when the pickup RPC arrives so I can't pickup. Any ideas?
welcome to replication race
hah
yep
Gratz on the promo to mod btw!
I could run some kinda callback when the item reps for the first time maybe?
i would probably set it as a property, and wait for the OnRep (RepNotify) to run
hmmm yea
is there a way to do that without making it rep lifetime?
just because there's lots of items and that overhead might stack up
no
bugger
you could client rpc, and if its null, poll for it, till its valid?
its what i do for weapons
i just set a timer, that runs, till its valid
just set timer next tick?
{
if (NewInstigator != nullptr)
{
SetInstigator(NewInstigator);
}
AKaosPawn* KaosPawnInstigator = Cast<AKaosPawn>(GetInstigator());
if (KaosPawnInstigator == nullptr || !KaosPawnInstigator->IsWeaponInInventory(this) || !KaosPawnInstigator->GetAbilitySystemComponent())
{
bPendingClientGivenTo = true;
GetWorld()->GetTimerManager().SetTimer(CheckPendingClientGivenToHandle, this, &AKaosWeapon::CheckPendingClientGivenTo, 0.1f, false);
}
else
{
GetWorld()->GetTimerManager().ClearTimer(CheckPendingClientGivenToHandle);
bPendingClientGivenTo = false;
ClientGivenTo_Internal();
}
}```
tyvm π
{
if (bPendingClientGivenTo && GetInstigator() != nullptr)
{
KAOS_ALOG(this, LogKaosWeapon, Verbose, "Weapon pending client check")
bPendingClientGivenTo = false;
ClientGivenTo_Implementation(nullptr, bPendingAutoActivate);
}
}```
like this
much appreciated
Yes, I'm picking up on an old project and thought they'd have fixed this by now
Multiplayer is kind of hard, as I'm sure you're aware, but I've been getting a pretty good handle on it. What I still kind of suck at is the "oh yeah" moments I get regarding game design things. Couple that with having to go back and make sure things still work with multiplayer has given me an idea. Create a single player vertical slice version of the game (which is designed to be played single player as well as multiplayer anyway), then once I've got my core gameplay figured out, use the multiplayer knowledge I've accumulated thus far to turn that game into a multiplayer game. What I'm wondering is if this is even sort of a good idea, or if I'm setting myself up for failure here.
i have been working on a combat system for my game for like 8 months and i have the sneaking suspicion that i could recreate literally everything in a weekend if it was single player. nearly every issue or challenge i've run into in the last few months has been networking or prediction-related.
if you made that single player slice, you would essentially have to start over completely for multiplayer to be added
but that doesn't mean its a bad idea, as you'd be able to test your core gameplay out before dedicating months to networking it
also, multiplayer is only as hard as you make it. if you want client prediction and to prevent cheating its a whole can of worms. a slower paced game or one where you're not concerned about making everything server authoritative is a lot easier
I know I'd basically be starting over, but I'm really tired of getting a system "complete" only to realize later I need to change half of it to account for something else, and then I have to change a lot of it after that to make sure it still works for multiplayer.
My game is non-competitive co-op and because of the single player aspect of it, user data will be stored on the user's computer then pushed to the server. It'd be pretty easy for people to cheat, but also no real advantage gained from it either.
what type of game is it? shooter, turnbased, rpg, etc.?
wave based survival with elements of tower defense; third person action rpg
Guys, afaik variables with RepNotify should call function on bots server and remotes, am I right? Cause rn I can see that its only executes on remotes
@steady musk RepNotify, in my experience, triggers first on where ever the variables being changed (if you change it on the client, RepNofity gets called on the client then called on the server), but yeah, it should be getting called on both
kk, need to review my actors then, thanks
i think in that case @uneven cliff there's not as much of a burden in keeping multiplayer working. most of the real challenge (at least so far for me) has been dealing with the server disagreeing with the client who already assumed he could do something
@steady musk are you in c++ or blueprints
c++
in c++ the server does not automatically call OnReps, only clients do. you can manually call the OnRep function after changing the value on the server if you need to
@vivid seal Alright, that makes sense. Thank you
in blueprints the OnRep is called any time the value changes on server or client
Damn, another setters π Hoped that it would work on both
yeah, usually you can just make a setter for whatever value it is, and just call the OnRep right after, that way its always called when you set it
not sure why they did it that way when blueprints works differently
Or I will use BP. Should work too. Thanks for that, almost broke my brains on that π
So my steam setup that worked in UE4.25 doesn't work in UE4.26? Any idea what changed?
How are you launching the game?
I tried both packaged and right click then launch game.
So what is your Steam setup like ?
What doesn't work ?
Does the Steam overlay does ?
Do you get the overlay?
That overlay doesn't appear. Strange
anyone already used the EOS for multiplayer?
Are you logged into Steam ?
What was the fix?
I had to logout then log back in on both my pcs. Then start the projects on both PC.
Beside that do you how to get the Voice chat working?
I tried the console command ToggleSpeaking 1
what do you use for multiplayer?
I have both lan and steam setup. I use Advanced Session Plugin.
ah ok, i dont want to make something homebrew
need matchmaking and p2p
EOS sounds not bad, going to test it soon
I only need the voice chat. I got everything working including text chat. I don't need matchmaking.
And I only need push to talk that's it
hmm ok, well i would have tested all before
but i cant imagine the steam apis wont work
no -one knows the basic setup that works. I got something going based on a tutorial.
ok thanks, what would you suggest?
Depends on your game
i want matchmaking, chat, p2p
just pvp 15 player per game, im not very familiar with multiplayer, first time i do it, usually i ask, catch some advise and then read the papers or docs, thats why i ask
PVP and P2P are mutually exclusive
P2P means anyone can cheat with no overlook
And 15 players is too much for a P2P game anyway
true that
What kind of game are you doing ?
15 player listen server, unless its very simple, would be expensive on the host (bandwidth and CPU wise)
3d game, with maps, couple of players on it (8-15), some NPC Bots too (GOAP driven), some nice concept (not 100% ready yet), first i need to do the recherche, tech concept, then prototype, thats why i ask, just if you point me to some direction i will check it out
15 competitive players = need dedicated servers, with all of the hosting costs and anticheat and all that nice stuff
Especially with bots since that's gonna drive up the server cost
Hey guys I am having a problem here
I am trying to display death widget to the player that died but it is displaying on server's screen for some reason, any help?
Damage happens on server I guess
ofc it would
but you cant put the widget on the server, so you need a client RPC, and a small delay before calling DestroyActor so the RPC goes through.
yea
I just figured that out and you message me lol
haha
thanks both of you still
π
that makes really sense to me, which service(s) would you recommend? which ones should i look into?
i would design the game first, think about this stuff last
sure, but just what are the services you would recommend?
i know its scenario dependend
the game is designed so far competative game with 8-15 players, some bots, some maps, bit like RPG/SIM wise (just not 100%* that depends also on the tech, efforts, costs for services and so on)
Make it work with 1 weapon, 2 players, 1 bot, a simple map, a game flow, and a server on your lan. That'll give you the experience to see how big of a project it'll be.
You don't need to cook a dedicated server, you can just launch project as server.
the network part is the unknown variable for me
@little shuttle Consider that this is the kind of game that will be expensive to get the players for, expensive to run and requiring constant work on anticheat, hosting, etc after the players are long gone
What is the state of the game right now?
On top of being technically difficult since multiplayer is like 5x harder
Competitive multiplayer in particular
im quite a good coder no problem, i just need to see the facts myself, cheating is very good point
never thought about it
You don't need to be a good coder, just a rich one
i recognized the services are pretty expensive
just had a look at the common ones AWS and so on
Anyway, sounds like you need to look into UE4 dedicated servers, look up the costs for Linux VPS that can run UE4, find an anticheat service with decent costs
what about EOS?
If you got the thing working with the dedicated server that you can run on some $5 a month cloud server, you can easily figure out how to scale it up. but I wouldn't worry about scale until you get the damn thing built. Nobody's going to cheat at a game that doesn't exist.
cant i include epic online services?
Yes or steam. It's fairly easy.
EOS is just a matchmaking service
Steam does it too
GOG does it too IIRC
Most platforms you can sell on do really
Just develop and figure out how to make a nice containerized dedicated server as you go. When the time comes to scale, you'll be a lot more set up to do it. be careful, don't get an off by one error and have a million dollar AWS bill
but EOS has p2p, maybe i can find a workaround that i will use it, or alter the concept, i have to think about it, maybe alter the concept a bit
EOS is not a multiplayer stack or a hosting service
It's just a bunch of tools for friends, matchmaking, login
ok i understand
UE4 does not do P2P, end of story
alright
You're confusing listen servers with P2P I think. You can easily have a listen server architecture just using EOS or Steam but any sort of scalable backend will require money.
It does listen servers, and that won't work with 15 players + bots
yes i know that
So if you really want UE4, it's source build + dedicated server
thanks a lot for the information!
The matchmaking service is irrelevant, you'll probably use a different one for each store
i think i will look into this solution
this talk saved me lots of efforts for sure
I have an issue with firing weapons in multiplayer. I have the client call an event to replicate to server, then the server calls a second event to multicast to all clients. However, I don't know how to tell the client that owns the gun to ignore the multicast so it can have real-time weapon firing animations and not wait for the multicast.
Check if the role is autonomous proxy in the mutlicast and ignore in that case
Or, since firing a weapon could be considered a state change, make it a replicated variable and ignore owner.
That also makes me wonder what best practice is here. I currently have ammunition in mag, chambered ammo, and fire mode simulated on all clients so if someone has one bullet left and starts firing full auto, but the moment they start firing they experience latency, the other clients will see them shoot one bullet and then hear the click of the hammer, automatically stopping the firing.
If ammo count is replicated as well, then replicating the state change to is firing should also run through the process of firing, losing ammo and then reloading.
I haven't actually been replicating variables. They've been calculated on each client individually. I'll try that.
I'm pretty new to this xP
It's a long road to learning everything. Doing it the right way the first time around is almost never going to happen. Do and learn as you do.
How do you replicate applying an impulse on an object? Is there a way to replicate object motion in a similar way to PlayerController replication?
I understand the obviously simple way of doing it with events but I feel like that isn't the proper method.
Stranger, I tried your solution. All of the clients see the gun as simulated proxy and not autonomous proxy, although I have my character script setting the owner of the gun to Self.
Upon further thinking, the FirstPersonCharacter isn't a PlayerController. I'm fixing that now. I wasn't going to sent this but I see you're typing now.
It's simple - you use events, aka RPCs, to replicate, well, events - things that happen and that's it
You use replicated variables for the persistent state of things
Ammo needs to be a replicated variable, weapon effects an event
Even if ammo is rapidly changed?
Yes
Alright. Could you give me a hint as to how the client has a PlayerController associated with it but the actual character I'm controlling is a FirstPersonCharacter? I believe my problem is a lack of understanding how those two are related and how to make the FPC owned by the PC.
The client can use another local-only variable for ammo that will be used for display, but the one replicated by the server, even if updated slowly, much later and possibly with holes in the data (like 10 9 8 5 bullets remaining), it's the one that matters
Character is owned by the PC
re: ammo variable - basically what you're looking at in general is that client-side will simulate things in real-time, but when the server sends back updated state, the client needs to check for consistency
Same goes for everything
I found the gamemode blueprint and I see how things are related now.
Like, every time you fire you could send the current time to the server along with your fire event, and the firing event on server, after updating ammo, will replicate the ammo value + that time value
The client would also store locally a list of firing events with ammo + time
And every time ammo replicates you can find in the list what the ammo was at a particular time, and correct discrepancies
(Or you can simply assume ammo only decreases until a reload, and only update the local ammo when the server's version is lower)
In checking for a discrepancy though, wouldn't it still just be easier for the server to say "hey the value is X now"?
That's what a replicated variable does really
But the variable replicates 3-4 frames after the client fired
You might have fired again since
Ohh I see now.
So other clients are (in this example) predicting shots because of automatic fire and then occasionally checks with the server to see if the count is accurate.
I almost feel like this is an over-the-top solution because other AAA titles seem to not consider this at all. If you fire your weapon and lag out, everyone else sees you firing indefinately until the host relays to everyone that you've been disconnected.
I'm talking about the authoritative client here, the one firing the shots
Remote clients are much simpler
But your client cannot fire twice, see ammo go from 3 to 2 to 1, then back to 2 (server replicates for 1st shot) then 1 again (second shot)
That just sucks
You can have one yeah
Looking for some direction. I'm unsure of how to structure my latest inventory iteration. In short, there's going to be a ton of basic items that really only require three variables. But I also have a few that are going to need quite a few more to keep state. I'm unsure how to structure this because I don't really want to have simple items replicating extra variables. Do I simply have two different replicated arrays, one for simpler items, and a second for more complex items, and combine them on the UI?
I can throw in my two cents but, believe me, it's not worth more than two cents.
Could you possibly have an array of an InventoryItem object, which parents SimpleItem and ComplexItem?
Does that work with structs? Can you make two child structs and then an array out of the parent and have elements replicate differently?
Unless an actor has been torn off, is it best practice to only call SetLifespan on the server to destroy an actor on both server and client?
I don't know the answer to that question specifically, but I do know that calling destroy on the server takes care of replicating to the client so I would assume that means the same thing for SetLifespan. It's going to get destroyed on the server which replicates down so there is no reason to call it in both places unless it's not replicated anymore.
Why not test this with a small sample? Create a simple parent struct, two child structs and fill an array with the child structs. I would think this would work.
Doesn't seem like it would be too hard to throw together a small example. Parent struct with one property, two different child structs with one more different property. See if they replicate when put into the replicated array.
You probably just need to try to cast them to each child struct and see which succeeds and there you should have your child struct.
What's the correct way to track which player has interacted with something? Is it by the player controller?
PlayerController, Pawn or PlayerState
are good choices
depends why you need to track it
My prototype requires that a player can switch sides during a round
If they are captured they 'work' for the opposing team
So I'll be destroying a player pawn so they look different when captured
Im having a strange problem.
When I packaged my game and sent it to my friend, we connected via Steam SDK (its a multiplayer game). Up to this point everything seemed well.
But when he made his first move, game crashed.
Nothing like this had ever happened before (I was testing is inside PIE, but server traveling is unable there).
Have you ever had similar problem ?
I am having a problem in 4.26 with my cameras always resetting their rotation to 0,0,0 on possession on a dedicated server. Does anyone have any thoughts on this?
Steps to replicate problem:
Create new third person template project.
Remove preplaced pawn.
Add two new player start with different rotation.
Remove default pawn class.
Go into GMB and make it spawn and possess two third person characters at the player start transforms.
Launch game in "play as client."
Expected: Characters will spawn with same rotation as playerstarts and camera will match rotation.
Outcome: Characters spawn in right spot with correct rotation, both cameras default to 0,0,0.
@meager spade I have been trying to get calling RPC's from UObjects working without much luck. Seems to be crashing the client. Do you know of any common pitfalls?
the UObject has to be replicated ofc
Does CreateDefaultObject work the same with components and subobjects?
CreateDefaultSubobject**
you mean with components and uobject?
yes
yes
hmm not sure what I am doing wrong than.
@chrome bay was it you that also made a post on your blog about RPC's in UObjects?
ah it was i found it
@gilded vapor https://jambax.co.uk/replicating-uobjects/ maybe i missed something
yaah was me
Weird question here, not sure where to ask... had a few people joining my client and joining a server. The server IP/Port display by reading from a JSON in an website and then people can join different servers.. this one guy couldn't see the server list, but also, when I told him to open by level by typing Open LevelName, he couldn't do it either. The game "refreshed" but he didn't actually change levels
Other people both from US and EU could join without any issues
Somehow I've made negative progress. Now calling a "Run on Server" event, even with Reliable checked, isn't working anymore.
that got me reading about your burst counter solution, that was a nice read
yeah pleased with them so far, got a backlog of things I wanna do!
Hello, im doing a multiplayer game for UE4 and ItΒ΄s a party game where all playes have health, the thing is, that I want to have persistant health from each player between levels, and also be able to tell if one player health becomes 0 so that everyone looses, any advice on how to do this in multiplayer, I was going to do a GameState but I have heard that itΒ΄s better for persistant variables tu use a game instance, any advice?
Player state?
def. PlayerState, with seamless travel and CopyProperties override
any player that hits 0 should signal gamemode (on its server instance) to end the match
Hey guys!
Multiplayer related question here - any ideas/tips or references would be very welcome!
In shooter games when player uses shoot functionality as far as I know the shoot event is also called from client side (to avoid delay) and later on validated by server if it hit something. So here we have a case where we can't see the bullet.
What about games where we have 0-gravity visible bullet that bounces and we have to keep the fast-paced movement information in sync for all the clients.
As bullets travel quite fast and with small lag from client side, when player moves too fast - bullets just overlap with the player and nothing happens (from client side).
Maybe I have some problems implementation-wise, but it is possible that I don't know some crucial information, so I'll ask that anyways.
Thanks in advance!
How do I replicate pausing a montage? Pauses fine in singleplayer. Montage plays in multiplayer, but does not pause. Server is running a multicast montage pause. Also tried using play rate 0.
As the bullet travels, do a trace from previous location to current location. If you are worried about precision, you can make this run every frame for a bullet, but that may get expensive. I tend to make a TracesPerSecond variable and setup my trace event on a looping timer with 1 / TracesPerSecond delay. Then you can easily adjust it to your liking.
The visible bullet would just be a static mesh with no collision, just for show.
Figured it out. I guess I can't run a timer server-side only and multicast from that timer. Client can't pick up variables used in the timer, even though that variable also exists for the client and is populated correctly.
Thanks for your answer.
Unfortunately, collision is required element for the bullet for gameplay's sake, so that when bullet bounces back from player, other player can react on it.
Another thing, it would be required to trace not only the target location, but also the surrounding area (let's say some other moving object collides before bullet arrives to destination) - so it seems really expensive.
To try and be that accurate with bullets would be very expensive, I'd think. Like trying to program the bullets to be able to collide with each other while moving 1000 m/s, with physics activated to account for ricochet.
@feral tendon There is a reason few games do this, it's just really painful to do. Physics are one option - but multiplayer physics in UE4 suck so you're better off with a bullet that traces multiple times per frames basically substepping on tick. We did that on Helium Rain with hundreds of projectiles, though obviously not in multiplayer
It's not that expensive CPU wise
The problem is more that the travel time of bullets is much smaller than ping
Trace and fake it is the only viable option really.
You can even do ricochets by getting your normals and redirecting the trace.
And do penetration with traces.
You just gotta get creative and use randomness and math.
Could even account for wind direction with traces, hehe. Just add a slight angle adjustment from previous trace.
If you shoot something going 100,000 cm/s and a player has default 600 max speed. Yeah, it won't miss them if it is on target.
@feral tendon The only thing that makes sense in a multiplayer context is to trust the client to some degree, predict movement of moving objects assuming constant velocity, run the simulation instantly on the firing client based on the current scene state, and then send the server an array of locations that the bullet bounced at. The server can then tell that to other players. All players then replay the simulated trajectory over time, entirely locally. This way, you don't have a bullet actor or component to simulate or replicate, it's very light on networking and only requires a tiny bit of CPU time on the firing client.
The reason you need to simulate everything once is that determinism in Unreal is poor
You can try checking on the server that the shot makes some sense for anticheat purposes
How about Chaos? Do you think we'll see improvements in multiplayer physics with Chaos?
When it's ready
Don't expect determinism though, that's nigh impossible in a game with variable framerate
Oh. Right
Among the multiplayer tutorials and VR tutorials, I can't find very much on multiplayer VR tutorials. Does anyone have some tips that could save me and my friend some headache down the line?
Of course, we want to replicate player controller positions, finger positions, and head position to other clients.
VR multiplayer is going to look a like like VR, and multiplayer
Technically it's just the constraints from both
The main concern for you is going to be the player base
As in the player controller?
Or the demographic?
I know this seems pretty ambitious but we're trying to develop cross-platform between VR and PC.
Yesterday I realised it would probably be easier to develop VR first, then make PC users emulate a VR user and not using animations like a traditional FPS.
@torpid elk As in the demographic.
Multiplayer for indies is difficult because, well, a lot of such games never find their audience and end up entirely unplayable
VR is a niche market, so multiplayer VR as an indie seems like a difficult bet to me
My friend and I are just doing it for fun and experience. We're not trying to be competitive in the industry right now.
Although from what I know about indie games, one of the biggest factors for getting popular is unique gameplay. We have some ideas that we're going to prototype and see if they are enjoyable.
Hey, you ask for tips, I'm giving tips π
Is it really not possible to call RPCs in pawns you have ownership of but don't currently control?
@brave solar Any Actor who's Owner AActor pointer variable that is set on the server to the correct instance of the player controller wanting to RPC, then that client can use that actor to Server RPC. Pawns simply have this set for them when a controller possesses them. So if you set a pawn's Owner on the server to a client's controller, and nothing else possesses it, you should be able to RPC from it. Although I'm not sure how that works with AIControllers and the like, whether they override that back to the server.
AIControllers are not replicated by default
and its usually simpler to leave them that way
Controllers are typically client side anyways, correct? And AI would be best handled directly from the server?
Oh yeah of course, I forgot the gamemode has some events that reference player controllers too.
Ah yeah it does appear RPCs don't go through if it's possessed by an AI controller, otherwise they do
I was meaning more that I'm unsure if you forcibly set the pawn's owner as a client controller, even if it's possessed by an AI controller, if the RPC still works. For instance, I'd assume that even the AI controller's possess sets the Owner variable to that controller, but does it still work if after that, you then set the Owner variable to a client controller? The could still use the AI controller and be controlled on server, but clients could use the pawn actor to RPC?
I never tested that in my RTS game. All of that was Player Controller routed.
I really wouldn't rely on "AI possessed but player owned"
Are there any good resources on setting up a dedicated server for multiplayer capabilities?
Without using Steam online subsystem API
Steam is unrelated to dedicated servers
The doc is here : https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/HowTo/DedicatedServers/index.html
How to set up and package a dedicated server for your project.
Anybody know offhand what happens if you end up with actors in multiple ReplicationGraph nodes? For example, say they get sent as part of grid spatialization, and you have an alwaysrelevant node for things like team reveals. Does the information get sent twice or does it simply end up added to the list twice?
Anyone know if networked actor attachments are handled the same way as networked component attachments?
If I remember correctly all of the attachments are handled same way by default
Anyone know why this isn't running after creating a session and opening the level? I assigned the correct GM and pawn for the level but it doesn't work
if you need more information please ask
what would be the best way to do a generic "ability" class that both npc and player abilities are based on? i originally just had one ability class, but realized that like half of the functionality was strictly for prediction, and almost everything replication-related was unnecessary for non-player abilities.
i was thinking maybe have the generic ability class be the npc version where everything is intended to run on the server and just replicate display info to clients, and then have a PlayerAbility class that inherits from it and adds all of the client prediction and such, but there are a lot of things I would need to replicate in the PlayerAbility class that wouldn't need to in the base ability class. is there a way to make a child class replicate properties that the parent class didn't?
GAS
@kindred widget sorry to bother you in another channel but i thought this problem would fit here better:
what do i do here if i want an object reference on the client, like here?
(it won't just let me use the regular "target" value)
You're trying to make one character launch another? If I'm understanding correctly?
well that's my goal but with this i'm making a test "self-launch" event
the target input pin is so i can get the player's damage amount
i'll make an "aggressor" pin later
It might be easier to do a mix of normal and regular damage calls on the server side. Personally I'd just make a new damage type for knockback, and handle it on AnyDamage event in the hit character. Then on hit, you could apply normal damage via ApplyDamage that would affect health. Then after that call apply knockback via ApplyPointDamage, and use the Point Damage's Damage amount as the knockback strength.
damage isn't the actual ue4 damage, it's its own variable
i thought ue4's damage system was needlessly complicated for my liking
hey guys when i load a level just on the listen server the screen goes black however if this happens on the client they go back to the main menu any ideas why
How are you loading the level?
its ment to be so you can disconnect when ever you want then a slot is opend in the server for someone else
i used the remove player function to in the gammode
so to generalize my earlier question, is there a way to have a property that doesn't replicate in a parent class, but does replicate in a specific child class?
@jaunty plank not sure if this will help, but try specifying the directory - /Game/Maps/YourLevel - though, that single string should be okay presumably if your map is in the right directory.
ok, that would be wierd if that works cause it works on the client just not the server
And your clients are getting booted back to the menu?
yea
Anything in your console?
some unrelated widgits things
unless its in the main menu and not getting the widgit
its not that there about the player UI
@jaunty plank Are you just trying to make the server move itself and all connected clients to a new level?
no its a like a quick round based game when you get killed it should take you back to the main menu where you can then find new servers
Odd that it only happens to the listenserver.
i might just need to move to dedicated servers it would also solve the problem if the host dies early on that everyone gets disconnected, it just looks really expensive to do it
Depends.
I'm hosting a dedicated server for like 0.12c a day
It's weak-sauce, but it's good for testing
i was looking into doing like amazon game lift but that looks like it can get expensive fast
All big cloud providers AWS, Azure and Google are expensive...
Have you thought about DigitalOcean or Linode
i havent heard of them ill check them out
Both of them are good and they only lack game specific framework or serviec like GameLift of Playfab.
One more point about Gamelift, whatever price they have given on their page is only for 15 days not 30 days.
yea, i just need some sort of way to host a dedicated server i can do most the code myself for it, i might just buy a shitty server of ebay and and port forward my internet that should work for testing lol
For testing you could run on DigitalOcean for free.
When you signup you get free credits
ill have a look thanks for your help its really appreciated
And one server equivalent to AWS free offering costs 5$ on DigitalOcean
And free network outgoing is 5 TB per instance
sounds good
For my game I have choosen DigitalOcean already
yea i wanted to use p2p for mine because of its expandibility but using it has caused so many more issues i think its just easier to use dedicated servers
what service would you use on digital ocean for game server hosting?
thanks
yeah sorry Boris, I use DO too
yea i knew i had to go dedicated at some point guess now is a good time to start lol
I went straight off the bat
i wanted to see if i could go p2p but just for the way my game works it makes alot of sense to go dedicated
Anyone familiar with how you could check on a client whether a level streaming operation started by the server is occurring ?
you could put a variable on the game state and when you start doing an operation set it to true and look for it on clients
No, that can't work
or do a foreach loop on the gamemode through all your player controllers and set it variable or call and event through that
I'm asking how to check on the client whether the client is done loading, regardless of whether the server is done loading.
Is Level Loaded
that should tell you when its loaded on the clients i would persume
Okay please don't answer if you don't know, I want to know whether
a level streaming operation started by the server is occurring
I don't want to know whether the server started or finished or whether the level is loaded
Alright, iterating on GetWorld()->GetStreamingLevels() with IsStreamingStatePending() works
Will a dedicated Server run the map blueprints?
And will it also run on the client?
I mean level blueprint
is there any proper workflow of using DataTable? cause I think i'm kinda lost, and I have been making tons of function to find what sort of data it's holding and load it accordingly.
E.g. survival game that player select a character from a DataTable and each character has a very dynamic tools (each tool has it own DataTable) and since all the character share same class, i end up making functions that return type of tool and extract the data accordingly, but the problem is if there are like 100 tools i'll end up making 100 IF to check the type of tool and i don't think that is efficient.
How do you tackle this?
actually it's not networking issue, it's more of workflow
even i write OnRep notify, i have to end up checking one by one of the DataTables to see which one is match
I dont know much about data tables, but can you not iterate through an array that holds all your tools (Wrench, Screw Driver, etc)
and check for equality there?
Or better yet a tools->enum map so that you just return the value
the reason i'm using DataTable is to have their properties, and maybe there are 5 different types of Wrench
and let's say if I want to make 5 more types I have to update the Enum, and that can easily get really big
DataTable is very powerful, but i don't get the workflow of loading dynamic stuff from it, without going crazy
The idea is each row in the data table stores the information for each item
If you have to have different data tables for each item then it doesn't make much sense to use them at all really.
Then it's just a case of putting the enum in the data table row, and getting the row and returning it.
Validation function is only a CPP thing, right? Can I add a validation function on my blueprint based RPC? π€
CPP only yeah
@chrome bay true, but what if they do have different usage? like each tool has it own attachment and some can be use to fix stuff, and some can be use to attack, and some are attachments and not completed parts. let's say if i generalize them i can make roughly 30 types, but still i have to loop them and check them against the DataTable right?
But you can sort of do the same thing manually (RE validation - just kick them)
The point is you don't have a data table for each type
Each type should be in one data table, and it's the row that determines what enum it is
That can only work obviously if "wrench" and "hammer" have the same base data struct
But if they can't, then a data table probably isn't a good use-case here
stuff like TV, Radio, Gun, melee, etc they don't have similar functionality
so if not DataTable, what other option do i have?
store the data inside the object itself
A data table doesn't make a huge amount of sense if all the things that have data require a complete table of their own.
It's for storing many variations of the same data type
Don't forget you can also do struct inheritance
So you can have a base "ToolDataRow" type that contains the enum
true, in case if i'm the game designer and balance the game, which not like everyone know how to go into blueprint and balance the game right?
And you just lookup that row type
{
Enum TypeEnum;
}
struct FWrenchToolData : public FBaseToolData
{
// other data only for wrenches
}
struct FHammerToolData : public FBaseToolData
{
// other data only for hammers
}```
psuedo-code but that would be the general idea
wait, you can inheritance struct in blueprint?
i see... okay
But then if you just want to retrieve the enum, you can just FindRow<FBaseToolData> without having to care about the specific type.
But again it may well not make sense to keep some data in a datatable, you might want to retrieve something like that from the object directly.
E.g, I assume a "Hammer" and a "Wrench" are not the same Blueprint, so it might make more sense to have the enum there instead
generally anything using the table shouldn't be casting the table to different types, it should be agnostic
ah what I mean is more the if/else/if/else etc.
Anything that's using the data table shouldn't care what specific data table it is, just whether it has the right row data
i use derived structs for weapon data, i have BaseWeaponStats that is the primary stats for all weapons, but specific weapons (ranged/melee) have RangedWeaponState/MeleeWeaponStats respectively. But majority of all access is to the BaseWeaponStats. I found this the best approach for me. But you can access just using the BaseWeaponStats and casting, as long as obvs the data table in question is of the type you want to cast to. For example ```const FKaosBaseWeaponStats* AKaosWeapon::GetWeaponStats() const
{
UKaosWeaponItemDefinition* const WeaponDef = GetWeaponData();
if (WeaponDef && WeaponDef->WeaponStatHandle.DataTable)
{
return WeaponDef->WeaponStatHandle.DataTable->FindRow<FKaosBaseWeaponStats>(WeaponDef->WeaponStatHandle.RowName, "GetStats");
}
return nullptr;
}and i have this helper //Templated version to get weapon stats
template <class T>
const T* GetWeaponStats() const
{
static_assert(TPointerIsConvertibleFromTo<T, FKaosBaseWeaponStats>::Value, "T must derive from BaseType.");
return static_cast<const T*>(GetWeaponStats());
}```
Is it normal for the host to print a joined player's name to console?
My team is sure its not something we've added but I've never noticed it before.
Hey so whats the downside of using rootmotion for multiplayer?
@meager spade are you from germany?
just ask because i did know a gpu coder from munich named kaos
If you were to have certain rules that a team has to adhere to would you put all those rules into TeamStates? How would you go about setting that up? Would you use the PlayerState as the parent class or something?
It seems more sensible to put team rules in the Game Mode. Also who is in each team.
hey, does anyone know how to make ALSV4 work in multiplayre?
Hello, when using servertravel with seamless travel enabled in my gamemodes my game crashes. any idea why this could be? thx
are u playing in standalone
yes
how can i Replicated flashing spot light over osc and a server ?
@lilac raven can you show the crash?
yeah one moment and ill recreate it
hey @meager spade
can i dm you?
Not really, if you have a question ask here, unless it's regarding a server issue π
ah i see
im trying to make ALSv4 work with multiplayer, any leads?
aswell as some animal npc that roam around the map and react to playeres
i did find this
but
Hey guys - would like to ask your opinion towards Net Update Frequency. In a PlayerCharacter with CMC, what's the "ideal'? What are your comments on that?
not sure about it, as i dont use c++ or know it
@meager spade seems ive done something wrong in my bps? Getting objects with a null outer is no longer supported. If you want to get all packages you might consider using GetObjectsOfClass instead.
this is what i get
im using server travel even a different map and with the same gamemode but still crashing
@vapid folio maybe try it? I am not familiar with ALSv4
can you show the actual error @lilac raven ?
@meager spade I narrowed it down to this, for some reason its trying to find ThirdPersonExampleMap? yet im asking for my custom test map
you would have called ServerTravel somewhere
and you verified level to play is not ThirdPersonExampleMap
do you have any references to that in your project settings?
it would not just try to load a map for no reason
I dont believe so, we never used the map. its very strange to me
this is LogStreaming tho
not seamless
its like its trying to stream that map into that level
but its not cooked
I cooked everything in project for development purposes
how exactly does seamless travel work with multiplayer?
this is not a seamless travel issue tho
this is your sandbox map is trying to stream in that map
ohhh
or trying to load it for some reference
i have changed it to a different map now to see if it works
just crashed again. ill check the log, i should mention this is not a new project its my teams uni project we have been working on since september last year, everything works fine such as servertravel but im trying to implement seamless travel
same error... im going to put the third person example map back where it was
weird
@meager spade im stupid π i had third person example map set as the transition map
i kinda figured tbh, that was why i was poking down that rabbit hole
thanks! imagine me programming a full on multiplayer system for our fps game and then doing that facepalm
Iβm trying create a multiplayer trivia game. Interacting with Objects in the level will show you the questions. What would be high level architect of this?
Letβs say I have an interactable actor. Where would I store the questions I assume in struct format and how would I store the answers
Also I need to keep scores for every players.
you'd probably want the texts alone in a DT so you can localize it without resorting to suicide
i'd use a gameplay tags for questions and answers
and use those tags as rownames for text DT
like
Question.MyFirstQuestion.Question
Question.MyFirstQuestion.Answer1
....
then your data struct for a question would have
FGameplayTag QuestionTag;
FGameplayContainer AnswerPool;
FGameplayTag Answer;
those are all nicely replicated as integers and client has the text tables to translate tag to question/answer
networking is pretty trivial, probably direct RPC to a controller(s) to ask, RPC back to answer
note that this structure allows you to provide a pool of any number answers, then just show the correct one + 3 others at random for example
Letβs say in multiplayer env a player walks to the actor that has the question 1 then to the next one that has q#2. How would that look like in bp?
Also I want to utilize the framework such as game mode, game state and player state
@winged badger Would this work?https://gyazo.com/807460ec12535e81702b723eaffa8b08
Anyone here use the UE4 EOS plugin yet? In the notes they said they tested it with ShooterGame, but I think they meant they just internally tested it. The current project doesn't seem to include any hints about setting it up with EOS
I've got the plugin built and it is enabled in my project. But I can't seem to transfer the code from the EOS samples in the SDK over to the UE4 project. It complains about unknown types.
I could never get the EOS stuff working
I got the samples project working with minimal issue, at least to where I could host a dedicated server session
Now I'm trying to get their plugin to work ><
I have a working dedicated server.
My client can connect but gets booted out.
I have the server log but don't understand the error message.
Anyone have a few moments to point me in the right direction for the following:
LogScript: Warning: Accessed None trying to read property CallFunc_Create_ReturnValue
BP_Survival_C /Game/Maps/ServerMap.ServerMap:PersistentLevel.BP_Survival_C_2147482453
Function /Game/Blueprints/BP_Survival.BP_Survival_C:ExecuteUbergraph_BP_Survival:006B
[2021.02.02-02.37.07:506][665]LogScript: Warning: Script call stack:
Function /Game/Blueprints/BP_Survival.BP_Survival_C:ReceiveBeginPlay
Function /Game/Blueprints/BP_Survival.BP_Survival_C:ExecuteUbergraph_BP_Survival
Greetings Fellow Devs, I am in need of some help. I currently have a Dedicated Server which works on LAN connectivity. But when I attempt to log in from outside of LAN or in this case from the internet, using the Public IP I get from doing simple whatsmyip search, it doesn't connect. It won't work with Open "publicIP" or ClientTravel to IP... I already port fowarded my router but still nothing over the internet works, I also disabled my routers Firewall and my windows Firewall while testing and nothing. My question is, is there something else I might be missing? I do understand some ISP block certain ports, might that be the case? Honestly I'm not sure what else could be the issue.
I also tried Port triggers, Inbound Rules and DMZ but I understand that removing both Firewalls anyways would override all of these options.. The server log does indicate "NetDriver listening on port 7777"
I found this,I forgot where I found it, but this might be useful to yall. Someone basically made a logical overview of multiplayer in ue4 that easier to understand than the documentation
Hey, im attemtping to make a Player Class selector! and if you havent guessed im having trouble, my problem is i want all the players to spawn in when all players have selected there class and are ready, they can select there class but the ready system isnt happening, ive attempted this mephod so far, using a integer in my player controller and making it go to the amount of players are in the game but i think im having a replication problem, it just wont go past 1, even when they all say they are casting to server, soo any clues?? or any examples of other systems people have made???
@spring swift It is very likely that you're simply updating the server's version of each player controller when they're ready. So each one reports that they're ready, but it only goes up by one on each player's server version of the controller. Do you want people to be able to see who's ready in the UI?
I would use the client's controller to make a ServerRPC to get to the server version of that controller. Then use that to tell GameMode it's ready. GameMode can update that controller's PlayerState to reflect that it's ready. This ready variable can replicate to all for UI purposes. Then after setting that, GameMode can also run a check on all existing PlayerStates from GameState's Players array. It can collect those variables and check if any one of them is not ready. If all are ready, start game. If not, do nothing until the next player checks ready.
Thanks for that, im gonna give it a go tomorrow π
Is there a way how to easily identify whether the code is running on the server or on the client when hitting the breakpoint in the C++?
There is, I saw it on Twitter ages ago. But I keep forgetting
Ah cool, do you remember if it was related to calling something from Immediate window or watching some var?
Iiiii thiiink it was some command line var that you add to the debugger
okaay, thanks. I will keep trying, glad I know it is possible
Working on a multiplayer game in @UnrealEngine? Add UE4Editor-Engine!GPlayInEditorContextString to the VS watch window to quickly see whether you stopped on the server or a client at a breakpoint during Play in Editor #ue4 #ue4tips
114
@trim kindle
Found it
So it was a variable watch
I remembered wrong
awesome, thanks. I have been messing with Immediate window and calling some functions which can give me the value.
Will try that
Also leave Michael a follow. He has good tips :P
Yep, I definitely should do so. His posts are gold since the beta.
Hey guys
I have set up a couple of dedicated servers for a project.
Is there a way to check if a server is available/reachable/online?
When i cant reach the server i.e. during testing out how maintenance would be handled, the game just resets to the main menu.
I would like to get a ping back that server is not reachable and display it as a widget instead of reset the game due to a time out
@north sierra You need to implement some sort of ping for dedicated servers. If you know backend the exact tech you need is zoo-keeper and heartbeat.
If I m not wrong, GameState do have ping API, but it is for connected clients in a multiplayer match.
Ping may not be enough. You may needs to implement a sniffer for your application state as well. Because your physical network may be fine in the server, which means the ping replies, but if your app is in a stale state, then your ping is not good enough...
What is the best way to implement voice logging with stock OnlineSubsystemVoice ? Our goal is to have voice logging on dedicated server.
How to restart map and travel all players to this map in multiplayer
restart or change map
Dedicated Server log question:
this yellow warning:
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
Dedicated server does start. I can connect to it, move around. Get that warning in log tho as well as a similar one when leaving? What am i missing?
You are missing an OnlineSubSystem but first of all you can ignore that I think.
Yeah i should have asked "Can I ignore this"?
Wasn't sure I needed it for a dedicated server.
im a bit confused, because of the recent multiplayer discussion, Epic Online Services, does offer matchmaking and p2p, across all platforms. so you dont need a server then.
cheating may only be a problem if your game gets popular not any prior
why did i get pinged?
when? i have a lot of discussions
days ago, when i asked about multiplayer solutions
it has Listen Server and Dedicated Server
i know
but its not about unreal its about a solution for unreal
with EOS i dont need any other service
sure you can go ahead and make UE4 work with p2p if you want
i can use p2p first with EOS crossplatform
but Listen Server (where one player is server and player), works ok
and if cheating gets a problem, i can think of something else
you really want to use listen server not p2p though
i went now thru all services and they are insane expensive
or listen server yes, but i need matchmaking
for that i need a server or EOS
thats the solution
i dont need photon, gamesparks, dedicated UE server, no just EOS
ok just wanted to add that
to close the topic
@little shuttle are you creating a B2B solution?
if the player character runs a "Run On Owning Client" event will that only run on the client that possess the character?
in normal circumstances yeah
So long as you haven't fiddled with ownership or anything
Multiplayer, but i dont want to find the best solution, i think working with EOS(for matchmaking, partycreation,...) and listen server works well for me, the only issue maybe the ping
ping of the host hosting the game
i can encrypt the traffic and well if cheating gets a problem and i have enough revenue i can find a better solution
but i think the ping could be the weakness in this case
cloud multiplayer services do not make sense, they are insane expensive
Listen server has many problems apart from cheating
like?
If the listen server player disconnects match ends
You can pretty much give up on any kind of anti-cheat if you want listen servers
yeah sure, but cloud services are no solution for me rather i will make another game
Client is one thing - but If a player has the server running on their machine, all bets are off
@little shuttle have you Heard of DigitalOcean or Linode
no
See their pricing
They are as good as AWS or azure of Google, but they lack game specific framework
it will be
when nobody knows your game
later you have money and you can use a service
for sure it will
good argument is the host quits
The problem you have is that Unreal, being sort-of open source, means that as soon as you launch there are already cheats available for the game.
host quits, host has very bad ping
Cheats that work in other games often work in many other UE games, simply because we're all using the same architecture
@little shuttle if you are going for listen server, then there is some extra effort in designing game in that perspective
whats the best guess in combination with EOS`
And matching is done by your game backend
and it has sessions ans rooms
Steam can do matchmaking if you really want it to
e.g. parties
Don't make a competitive game and you will be fine π
you dont need steam with eos
Also yeah, just don't make a competitive indie game π
In 2021, if you're building a competitive game and NOT using dedicated servers, you're setting yourself up for failure. Nobody would play it.
what about games like among us? the have lots of players too, they use photon
jambax ok, i understood
If you really wanna do something multiplayer and not have any support costs, make it PVE and use listen servers
Still things you have to consider. Indie multiplayer is a sorry state of affairs.
if it's PVP/competitive, then definitely
because of cheating, host quiting, slow ping?
i mean if its just a friendly PvP, and you state its not competitive and stuff, sure. But not many players will play
host quiting is really bad yes
But you can't really guarantee any kind of consistent experience to buyers if you only provide listen servers
This can usually happen very frequently
UE4 has no host migration by default, i have seen a few people implement it (or try) but i have never seen it
Do what we do, pay for a handful of "official" dedicated servers, then let players rent dedicated servers from third-parties.
its not just host quits, the host's internet could go down
host could start downloading and lagging everyone
I remember call of duty 2 allowed for people to host dedis
And youβd have communities that donated to keep them alive
what service would you recommend most?
Not the worst solution
Yeah, essentially the same as what we do now
you could do similar to Minecraft, just bundle a server people can use, as Jambax said
To clarify though we never distribute binaries, so nobody outside of our team or the rental companies ever gets the server code
that is developer decision though, but you could
yeah totally
This is of course all pending you making the game and getting people to play it first π
That's half the challenge π
then again as a solo dev, i would not want to do competitive game, start small, with a good game that can draw players, grow a team, then do it
ok you are right
the concept is very small, but it does not work without multiplayer
You are demotivating me.. I m solo and working on MOBA.
so i will archive it
are you using a dedicated ue4 server for it?
Unless you have good funds, marketing, etc, it is really hard to get noticed in the pit of indie games. Especially the saturated Steam, with 1000's of games not even worth the internet space they are on.
Yes
Dedicated Server, Persistent Survival Type game: GameModeBase sufficient or go with GameMode?
Yes
Honestly, I am against on that.
@little shuttle I m using Nakama and EOS for my game backend
And for dedicated servers I have locked DigitalOcean
sounds like pretty much implementation and maintaining efforts?
Not at all
Nakama can be integrated with EOS
Nakama is containerised.. so scaling is not a headache for me
you use eos for matchmaking and nakame for gamehosting i guess
There are serious problems is EOS..
That's why I m using Nakama to trim out shit out of EOS
I m using Nakama for user and friends management
That's it
It's free
i see 600 is if they host it, they provide the server on github
and you use it with ocean
Yes ocean
i saw, but i wasnt thinking that you can use the server for free
Ocean gives 100$ signup credit
So it's free for early launch atleast
Or even Google cloud gives 300$ credit
assume you will publish to mobile as well
So I mean the initial launch is not a problem..
The problem comes when you grow in players and don't make enough money
Yes Android in mind
i would do, just to get sure you get your playerbase
but sure @meager spade is completely right here, hard to get visibility now
thanks all, this was really useful information provided
If any big company or a youtube channel does game review , you can get a boost launch
its so complicated to make games in terms of efforts
its worse that every bad game makes it into the stores
yeah marketing is a big topic
#keywordmarketing and so on
At the moment I m truly focusing on building game first and then I do marketting stuff
me too
you just reminded me, but its another topic for another channel, thanks again for the information
i think that should be a good solution need to lookup the docs and make some effort estimation
@rich ridge why did you use nakama and not just an ue dedicated server?
Nakama realtime can't satisfy my MOBA needs
EOS has many problems.
- I can't remove any login type from EOS web login.
- EOS friends service is exclusive for luxurious studio. And I m solo and beggar studio.
- EOS ecom interface can only be used if your game is going to be published in epic store. My game is not for Epic store and getting your game on epic store requires you to be luxurious studio or need a strong lobby at epic games.
- It is very difficult to get dedicated support for EOS for beggar studio like me.
The only support I can get is discord chat.
- Whatever things I have explored in EOS, the EAS services are very slow in my experience.
Rather than having 100 Mbps connection. The auth login takes 10-20 seconds
@little shuttle I hope my experience with EOS helps you too
I choose leaderboard and achievements of EOS to use because I don't have budget to host database of huge pile of leaderboards and achievements.
I m only not using epic account services
And for account services I m using Nakama and my Nakama database will only have data of player registration..
The leaderboard and other databases will be at EOS side
I have no clue where to start if I want multiplayer like in Minecraft Bedrock
Essentially, host creates a world that doubles as a server, anyone with the IP can join in
its basically the same, just read the whole chat
I'm probably not looking hard enough
Alright!
So I'm looking for a listen server, that's a start
or nakama (opensource server on github, digital ocean)
Thanks!
Hi I'm developing a fast paced multiplayer game in UE4. I'm wondering if anyone knows anything about lag compensation and if it would specifically be able to work in the game i'm working on. Does anyone here have experience with lag compensation programming?
If you do understand how networking works, lag compensation is somehow intuitive. The best way to do it is having a synchronised clock that you can rely on
therefore you only would need to account for the roundtrip time to issue your actions
The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. In operation since before 1985, NTP is one of the oldest Internet protocols in current use. NTP was designed by David L. Mills of the University of Delaware.
NTP is intended to synchron...
when you say round trip time you mean "player inputs key, then server does action based off input, then sends back to client" right?
so besides lag compensation you want prediction?
ok so basically right, I'm making a fast paced soccer game. The issue I'm having is that input feels no where near as close as it does on singleplayer
I want it to feel as smooth as singleplayer
and no, round trip time is a parameter you can learn reading that piece of article I sent
so like when a player releases the kick key, there is a delay for it to kick the ball
and if your ping is high, it takes even longer
yes, and you understand why that happens, right?
not exactly
That happens because your code is server authorative, meaning that you are sending the input to the server and whenever the server ack's it, the action occours
if you think about how networking works... you'd need to send a signal to a server residing somewhere, your connection to that server might be good or bad
yes im following
and then the server reply to that signal to send it back to your client
which means that you have two latency points
upload data/download data
yes
the ping you see in your client is the roundtrip time between your owning client and the server
that is upload/download trip time
so... basically if your code remains fully server authorative
you cannot avoid this full roundtime trip delay, unless you do implement any sort of technique
to cheat a bit around it
how does one achieve this magical power?
let's try to be pedagogical for a moment, what tricks come to your mind?
i would think that the client does the kick on his end, then sends it to server, then servers sends to other clients
im not sure exactly how that would look programmed but that seems like the general idea
so there are lots of implications on doing the kick on the client!
hackable i assume right?
exactly, that's called a client authorative approach
you can mix a client authorative with a server authorative to have the best of both worlds
that's called prediction
im learning so much in so little time it's amazing
let's speak a little bit about overwatch, ever heard about it?
yes
Overwatch does some cool tricks network wise, I'll send in a moment a very good conference that I'll advise you to checkout because it might be benefitial for your implementation
so... imagine you are winston, you are jumping around with the "shift key"
ok im winston jumping around with the shift key
you will be allowed to jump the same frame you press the key, which is amazing, right?
hell yeah it is
now... you have some lag... that means that your jump take a bit to be streamed over the server
what happens if a curious mei freezes you while she sees you in the ground
however you just pressed the jumping key and you are in the air!!
something magical happens named... rollback
oooo
you were allowed to jump in your client... because your client didn't get a frozen state
however... to the server you are frozen
so.... your client does the correction, puts you back in the ground and sets your client state to frozen
which means that your client and server will be synced
so.... how does this work exactly?
you are allowed to jump in your client... the server will process the jump aswell if the server finds something going odd with your jump it will sync back to server position
or do whatever is needed
drawing incoming
im so excited
could this be done in blueprints?
Maybe, not very efficient though. That's why the CMC does it in C++.
You might just want to read up on it a bit in general
Let me grab you a link with some 2D test to further understand the concepts
That explains Prediction and Reconciliation quite well for the start
and just to add to what exi posted! https://www.youtube.com/watch?v=W3aieHjyNvw
In this 2017 GDC session, Blizzard's Timothy Ford explains how Overwatch uses the Entity Component System (ECS) architecture to create a rich variety of layered gameplay.
Register for GDC: https://ubm.io/2yWXW38
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://twitter.com/Official_GDC
GDC talks cover...
As well as Lag Compensation: https://www.gabrielgambetta.com/lag-compensation.html
And a LIVE Demo with some settings for each of the different systems: https://www.gabrielgambetta.com/client-side-prediction-live-demo.html
In the end you need: Prediction, Reconciliation and Interpolation
Or whatever other names they give this elsewhere
this is seriously great info ty both for all of it
I understand the concepts but I have no idea how to implement it into my project seeing as it's blueprints only thus far and I know very little c++
you can do this on BPs as well
it's just about understanding the concepts, there are multiple different techniques
and it would still be efficient?
you don't have to adhere per say to the literature
well the math for it isn't too expensive
so you can probably do it in BPs with no issues
that is absolutely great news then
but I recommend you to understand networking, context and whatnot
so you'll be able to open your mind to custom solutions for your context
ok i will study these articles, and the gdc conference ty so much for all the info
but I have no idea how to implement it into my project seeing as it's blueprints only thus far and I know very little c++
Honestly, I have never implemented this myself either and I can't say if you can do it in BPs or not. I only extended it in C++ and know how it works there.
I would however never really suggest doing it in BPs. But that's personal preference. I like BPs, but some stuff just fits better into C++.
(And not just because it's prettier :P C++ has other ways of handling the structures and data you utilize)
But we gotta admit C++ is prettier 100%
π
I default to C++ for these things as well, he'll get bulky nodes with some things done on Tick there
and that can get pretty unmanageable
but I've seen big boi BP's... some people manage
so up to them I guess XD
so you would reccomend c++ then?
yes
is there a way I can keep most of my blueprint code but then only implement the client authoratative functions in c++?
you can do whatever
that seems like it would be messy tho
but I would recommend you doing your "ability" framework directly in C++
Try it in BPs first
But complex Multiplayer games will sooner or later push you into C++
Specially since Epic just doesn't expose 75%+ of the engine
There is lots of variable and events you have no access to
you mean with blueprints i wouldn't have access to them?
if it's not exposed, no
also networking in C++ works a bit different
ie: onreps don't get called on the server
and i think only 75% not being exposed to BP was very generous
BP hater... I'm sick of you π
the reasoning is probably keeping the BP environment simpler
when you actually go and catalog what BP can do networking wise
it can send RPCs, it can set variables replicated with basic conditions exposed, it has basic configuration for actor replication and its replication callbacks are hacks
yep, you can't do much in BP's regarding networking π¬
thats the entirety of blueprint network functionality
also the only relevancy method exposed to BP's is the default net culling
although you have dormancy
one of the biggest things that are missing in BPs are custom net serializers, can be so useful
bruh a lot of this is going over my head now
in other words - you might be able to make it work in BP
Yeah, that's true hehe
but you have 0 tools to optimize your network
which effectively limits you to 4 player game
and a "is net relevant for" handle XD
i smell a profitable plugin
that's a bit mean, you can probably get to 5
not quite
π
as you can't really do much with structs in BP
oh ok yeah nvm idk what im talking about lol
so the problem is waaaaaaaaaaay deeper then just the networking
yep
I would like the game to be coded the best way possible but learning all the c++ knowledge required seems like a huge task right now. ecspecially when ive already gone into pre-alpha with the BP code i have
optimizing a network in c++ doesn't require a technical mastery of c++
but it does require you to understand the engine netcode very well
so would doing that be modifying the engine or would it be added onto the engine?
we are running a vanilla engine, so far we managed a workaround for every landmine unreal presented without altering the source
so would doing that be modifying the engine or would it be added onto the engine?
not exactly, you use the engine (sometimes the engine uses you).
so you create classes the same way you do in BP, inheriting from the playerstate, gamestate... etc
ok i see. so basically if I went the c++ route, i would have to redo everything right?
not quite
no, you wouldn't
all the mechanics and whatnot
once you know what you're doing its not too hard to move the (net)code to c++
your bp character can inherit your C++ character
not accounting for the mess you do along the way if you lack the skills for it
I mean... one learns messing around at the end of the day hah
so that means I can keep the character and soccerball class as bps then make a inherited c++ class?
i'm just trying to understand exactly how it would be structured
you can insert c++ base classes under blueprints
meaning if your BP Character inherits from Character, then you can create a MyCharacter deriving from Character, and reparent the BP to that class
so... it would look like
ACharacter (C++) -> MyCharacter (C++) -> BPCharacter (BP)
which then lets you add c++ logic to MyCharacter and therefore BP Character
exactly because when you create a (BP or C++) character in engine, you are inheriting from ACharacter (C++)
yes i see