I’m not saying his project is pointless; people make whatever project they want.
What I said was about setting a server cap to 50 players since UE4 can’t go far from that anyways, that is pointless.
Btw, If he develops a tech where a single spin can handle 500~1000 players online than would be a serious service because that is VERY important, it’s not about replicating WoW, it’s all about effective use of server CPU resources.
When you have to keep 200 “MyGameDedicatedServer.exe” running to have 1000 players online, then enjoy your server tanking and people giving your game bad reviews because of server instances crashing constantly and so on…
I think you might have misunderstood the 50 player cap on the developer license. It is not a cap on concurrent players. It is a cap on player registrations. Since I am hosting all of the data for people with developer licenses I do not want to have to store more than 50 players per licensee. It has nothing to do with limiting the number of players per map. It is a business decision not a technical one. The true purpose isn’t even storage, it is the fact that if you want to sign up more than 50 players, then you need to pay more than $50, because you probably aren’t still in development mode.
You won’t be able to run 200 dedicated server instances on one hardware device. This is why my management server allows you to setup as many hardware devices as you want and set the cap on the number of dedicated server instances per hardware device. I estimate that depending on your game and specs of the hardware device you are looking at 10 to 20 max dedicated server instances per hardware device.
It is true that Epic’s model of replicating all characters to all clients is inefficient from a CPU per player cost perspective. But that is not a problem I am trying to solve.
Thanks! Not sure exactly what you mean by some kind of starter pack, but I am working on a starter project right now. This project is based on the ThirdPerson template (I also plan on doing one based on the top down template for touch to move to point mobile RPG’s) in UE4 and will have you up and running right away! The project will be freely distributed and you can sign up for a free 14 day trial to the API to evaluate the product. Here are some screenshots from the starter project I am putting together. It is coming along great and I should have something to release soon.
Here are the main objects. The ThirdPersonCharacter inherits from RPGCharacter and contains the code for loading all the Character stats from the API. Third Person Game Mode inherits from RPGGameMode and contains the all of the Login/Server Connection code. Third Person Player Controller inherits from RPGPlayerController and contains code for saving the players state back to the API and setting up the Chat UI. My Chat Manager inherits from RPGChatManager and is responsible from managing the Chat API. By having this one Actor manage all the chat messages there only has to be one API call per server, not one per connected player. This really improves performance and network traffic. My Travel To Map inherits from RPGTravelToMap. This box volume is used to trigger the transfer to another map and you can see one has been placed at the right side of the screen in the map above.
In the screenshot above you can see how the Get Map Server to Travel To node is called. This blueprint node calls the API to see if the Map you want to transfer to is already running and if there are any open slots left. If not, it will spin up a new instance for your to connect to. When it is ready to connect to, the Notify Map Server to Travel To event is called and contains the Server and Port to connect the client to. Then the client is transferred to the right map.
In the screenshot above the Save Player Location blueprint node is used to periodically update the position of the player in persistent storage. You can adjust the frequency in which it updates to balance network traffic.
Here we use the Get New Chat Messages node to get any new chat messages since the last time we polled for them. I use a long polling technique to minimize chat lag. I also have chat related blueprint nodes for Send Global Chat Message, Send Chat Message to Channel, Send Private Chat Message, Join Channel (for persistent storage) and Leave Channel.
As far a dedicated server balancing, all I am currently doing is using a round-robin algorithm to pick the next world server (hardware device) to spin up a map instance on. So if it sees you have three world servers (hardware devices) and two of them are running 5 map instances, but one is running 4 map instances, then the next map instance to spin up will be on the one with the least number of currently running map instances.
If you have any other specific needs or something you are looking for, let me know.
Quick Question: How does your system handle disconnect events? Does it instantly Save all variables onpawnleave? or do you leave the character in world for a time, then save? This is something we’ve been trying to see how to handle best to avoid combat disconnects.
/shrug
Yes, I hook the PawnLeavingGame method in the PlayerController and then expose the event to blueprints where I call my Save All Player Data And LogOut node. This will handle some disconnections, but other types of disconnections like system power failures will not trigger this event. So I have a SQL job that runs periodically (once a minute or so seems good) to remove any players that have not sent updates to the API within a certain amount of time. As you can see in the blueprint below, I expose the RPGCharacter object for you in blueprints. If your penalty for dying is not too high, I would check to see if the player was in combat and then automatically apply the penalty for dying, so that players will not log out as a means to circumvent dying. With accidental disconnections happening less and less with modern technology, I don’t think this would be that bad. You are free to choose whatever system you want to use though.
Is it possible to emulate a H1Z1 server setup with this approach? Not the game itself but the way it queues up players, dumps to a lobby then spins up a dedicated server to transition the lobby too?
I’d be interested in checking out the API when you start looking for testers regardless. Sounds like an interesting solution.
I am not familiar with H1Z1, but I just watched some YouTube videos of it and I am guessing here is how it works. When people log in they go into a lobby map where they can run around, then when there are enough players it spins up a new instance for them and transfers everyone to it.
If this is the functionality you are looking for, it is possible with my system. Here is how you would do it. You would create a Lobby map instance that players would automatically be added to when they log in. Then you would add all the players in this lobby map to a group/party and when there are enough players you would have my system spin up a new instance and transfer the whole group to it.
Today I am working on making the World Server application more user friendly. Here is a screenshot of the updated UI with more configuration options. It also shows the new Test Connection to Management Server button I just added. Since networking / port forwarding is usually one of those things you spend hours pulling your hair out trying to figure out why it isn’t working, I figured I would try to make it a little easier. The Test Connection to Management Server sends a request to the management server, the management server then confirms that everything is configured properly and sends a message back to your World Server to let you know it is working.
Great work, looking forward to getting it implemented with my project in the future. Although will definitely need to talk over more as I am only interested in the dungeon instance per X players, when ready will more than likely go with the $100 option.
Thanks! Right now I am finishing up a template project and a few tools to get an early release out to a few people who are going to help me test this. After that, the next item on my list is getting the “dungeon instance per X players” up and running. It shouldn’t be that hard since I have most of the components needed to make it work. I will probably spend more time writing the UE4 blueprints to show how it works than it will actually take to get the behind the scenes stuff hooked up
Do you plan on adding a server-side database caching, to avoid rampant IO cycles?
Also, is quite easy for a UE4 server to eat beyond a 1GB ram from the server, a single process when the game client is significantly big enough (the dedicated loads in memory many of the client-side assets);
Do you have any strategy to mitigate that? I, mean, the more RAM a server eats the more expensive your metal will be monthly…
I don’t have any plans to cache the database on each of the world servers. Memory is going to be the bottleneck on the world servers, so adding additional memory usage probably isn’t going to help. I doubt the SQL database is going to be the bottleneck in this system. I manage a 250 GB database with hundreds of concurrent requests and we are able to average 200 ms response times. That is on mid-grade aging hardware: one 6 core CPU with 16 GB RAM. The secret is properly managing your indexes and internal SQL caching. SQL Server is pretty amazing when it comes to performance!
I minimize IO in my system by trying to limit the number of accesses to the SQL server. For example in my Chat Server, I use one request for all users instead of a separate request per chat user. I let you decide how often player movement (and coming soon non-player actor movement) gets cached back to the server and all requests are asynch so nothing ever waits (except the login request).
Yeah, UE4 eats up a ton of memory. I think people who are planning their business model for their game should estimate that each UE4 dedicated server instance will use 1 GB of memory. So on a 16 GB world server, you are probably going to max out at 12 or so dedicated server instances. A T2.XLarge (16 GB) on AWS is going to run you around $170 a month. Assuming your game can only support 64 players per map, 12 * 64 = 768 max concurrent players per server or ~ $0.23 per concurrent player per month. So it is a lot more than a traditional MMO would pay per player, but that is the price you pay for full action combat. Without modifying how UE4 works there isn’t much I can do to mitigate that. So I am just focusing on keeping my side of the equation as fast and secure as it possibly can be.
The problem with that math is, when you have around 20~30 players on a UE4 server, depending on how the gameplay is built, that one single server will take 5GB of RAM or around that lol.
I don’t even know how much RAM 64 players takes from the host. It would cost a fortune for fast-paced games; no wonder games like ARK decided to ship away the server to the players together with the client instead of hosting it…
I love the tech, I would be very interested in how a zone performs when loaded with characters walking around and a 20k terrain. See how much ram it eats up with 100 users online and walking around.