0
\$\begingroup\$

I've started with Unity3D to develop a multiplayer game similar to world of tanks, it's using authoritative server and I was able to sync movements between several clients. I'm using c# and on the networking part using sockets directly.

Currently, I have a hard time understanding how can the server perform operations such as:

  1. Calculate if projectile shot by client A will hit client B

  2. In addition to (1), also to see if the project did hit a static object (rock, metal...)

If we take into consideration that there could be hundred of player simultaneously, how can I approach this on the server side ? I'm looking to build myself from scratch everything in order to have a strong understanding of each puzzle piece.

On the other hand, I understood that there's the concept of headless server which is just the physics engine without rendering, however, this doesn't seem to be a scalable solution.

\$\endgroup\$
5
  • \$\begingroup\$ Can you explain why a headless server "doesn't seem to be a scalable solution"? Why would it be harder for the server to do items 1 & 2, when they're things we do all the time in game code? \$\endgroup\$ Commented Mar 15, 2020 at 13:18
  • \$\begingroup\$ @DMGregory, thanks for your intervention. To be honest, it's just something that I summed up from several articles I read on this subject as ppl are saying that it is not something for a production environment where there are hundred of players involved and the whole game must be running in parallel on server side to be able to look for all collisions and shootings from all players (lot of resources consuming). Can you help me better understand this subject, please ? \$\endgroup\$ Commented Mar 15, 2020 at 14:27
  • \$\begingroup\$ We can't respond very constructively to hearsay. Can you please edit your question to exhibit a specifically example of a problem you've measured, or a specific objection you've seen raised online (with source & context)? \$\endgroup\$ Commented Mar 15, 2020 at 14:29
  • \$\begingroup\$ Is this to show to the player projections of what would happen if they shoot? If so, you can let the clients handle that. The servers needs to do it when the player actually shoots. There are have been plenty of question and answers on optimizing collision detection, while most are not specific to Unity with C#, most of the advice applies. Have you seen those? \$\endgroup\$ Commented Mar 15, 2020 at 19:12
  • \$\begingroup\$ @Theraot - I'm looking to understand how does one simulate these actions on the server in order to validate them, which approach do they take and if are there standards, best practices on this matter. So no, I haven't found anything that could give me a good visibilty. if you have any books/threads on this matter, I would appreciate if you can share them with me. \$\endgroup\$ Commented Mar 25, 2020 at 11:05

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.