Basically what I want to achieve, is that my Multiplayer environment consists of a server who does all the calculations and game logic and the clients just retrieve position, action and state of the environment and display this. They then just deliver to the server a constant stream with the current input of the client. A typical thin client setup.
My main question here is, as my setup would need the server to have a dedicated GPU, otherwise I can use Unity and in other words, any 3D calculations based on DirectX and Co. I would have to write my own DirectX for the CPU.
So how to others achieve this?
The reason for this is simple, this setup is mostly not hack able. So there is no possible wallhack, speedhack, colldown hack, … As everything is calculated via the server.
Another very important fact in my situation, is the possibility to update some game logic only on the server, and the client’s don’t even notice the changes.
How can I achieve this?
tia Synergi
What you’re describing is basically an authoritative server. In an authoritative server the server machine is considered to be the “correct” version of the world, and all clients are just estimates. Clients simply send input to the server, and the server sends back the updated world state. By default this is how UNET works.
While this works great in theory, if you are doing any real time action then even a tiny bit of lag will be noticed. Most games resolve this by allowing clients to move there player immediately, and then correct the result when the true position is received from the server. I would look up client side prediction to learn more.
As far as GPU goes, unity can run in headless mode (without graphics). You can use the command line flags -batchmode and -nographics.
Oh was aware of the batchmode and nographics command line, but I was 100% sure that still needs a dedicated GPU. How are calculations then done, when not on a GPU?
And thx for the rest infos, Client side Interpolation and Timing the server so the clients view the past are concepts that I know already x) I’m just curious about the GPU part of a dedicated server x)
Is the GPU then somewhat virtualized via the Unity Framework or how do they do directX based calculations?
Server shouldn’t need any GPU dependent stuff… The GPU stuff would be dependent on what GPU is in the client machine since that is where content will be displayed. I haven’t played around with the headless mode of Unity yet, but other server environments I’ve run are basically just ASCII text display type stuff that is displaying log information and basic statistics and managing locations and anything else that needs to be authoritative. It is all basically just data. No graphics.
DirectX based calculations is a client thing. Not a server thing.
Now if you are talking virtualized and thin client being something like using a VMware type server, it has been a long time since I’ve used VMware or any of the similar type servers/clients. However, if I remember correctly, the VMware (and similar) clients actually setup and use the actual client’s display adapter even when running a vm session stored on the server. So if that is the case, the DirectX stuff would still be dependent on the actual computer running the VMware client. But like I said, it has been a while and I’ve dealt with some health issues that effect memory since I last used any of that type of software tech.
Yep, a headless server needs no GPU. All physics is just maths done on the CPU. This is the setup I use, and works great
1 Like
@BackwoodsGaming , Yeah of course I can understand this, but if I want the client to be like a thin client, the server needs to do 3D calculations. Let me give you an example to show what can actually happen (not in my case, but this is an real life scenario)
- We simulate an ocean in our game.
- A player is currently swimming in the ocean.
- To simulate and create waves we nowadays use tessellation.
- Tessellation is done on the GPU and not on the CPU.
- We want the player need to hold breath as soon as he is under water with his head.
- To check, if a wave is currently over the position of the with the tessellated waves, we would write a shader to check.
- The shader then marks then something, which we check CPU wise and simulate breath.
To achieve this in a “thin client” environment, the server needs to handle this calculations, so it needs to have a GPU.
I know this is not really common, because in 99.9% of all cases tessellation is just a visual thing, but I really just talking theoretically here, to understand, what the big industry is doing in such cases.
@Whippets , thx for your feedback, now that I now it works I’m fine, however it works on the technical side x)
If you play any AAA title and look closely, there are always things a non-game developer player will never notice. A lot of things are fudged. Not everything will be authoritative as one might expect and some things, such as what you are talking about may be based off of a flat plane for the water’s surface and not take the depth of the wave to the surface of the water into account at all… At any rate, like @Whippets said, all of the stuff on the server side is CPU calculations. Anything GPU related will still be on the client.
Honestly, I can’t see any case where you would do GPU stuff on the server and it be accurate on the client computer since the client computer will have a different GPU. That would be the equivalent of me having my computer work up tessellation on a new nvidia card with dx12 and then trying to display on a crappy graphics card for dx9 or a radeon dx12 card. I’m pretty sure they will all yield different results.
And in a thin client environment, even though that instance is being run on the server, I’m pretty sure it is accessing the client hardware. So it would be accessing the GPU that is actually in the client computer. My memory kind of sucks, but I’m almost certain that is how I remember thin client technology working even all the way back to when I was using Citrix thin client stuff back around 2000-03.
Would love to hear some input from folks that have actually done thin clients. Kind of curious what your application is. Is this going to be for a lan party type game? I’m having a hard time envisioning a type of game where you would want/need to use thin client for players. Or am I misunderstanding and you are just referring to thin client and headless server as the same thing?
Right, that seems like a specific use-case where you’d need to host the server on a machine with a good GPU - or alternatively speak to somewhere like SpatialOS that does simulations.
As far as the thin client part goes, I don’t see any issues with using uNet in a configuration to suit yourselves.
1 Like
@BackwoodsGaming , Yes to your last point. When I talk about “thin clients”, I use this as an acronym for a gaming machine, that just displays and sends input and does no game relevant calculations. Of course these are not VM or real thin clients. Why I do this, you can read in my first post.
1 Like
@Whippets , thx for your input.