Server architecture: not for fun

I formulate the best ideas in pdf write udp p2p + server chat. I lay out in githab for tests.

Ok. I formulate the best ideas in pdf write udp p2p + server (who plays for monsters) chat. I lay out in githab for tests.
what do you think?

Ok. p2p + server (monsters + quests+map, system) and p2p udp chat (compare packages from different members of the network)?

Just have the server relay some messages in TCP via SpiderMonkey (it will use TCP by default – so don’t worry about doing anything special). There is really little reason to not have everything done via central server – it also prevents players from DOSing each-other.

Multiplayer online game - the transfer of packet client-server, p2p, tcp / udp, graphs
Description of the process and postavnovka tasks:

  1. Each player takes an action at the client, and must notify the monster players and game objects within a certain radius.
  2. The player must see the 3d objects and monsters only opredennyh radius.
  3. Server Centre the instrument of action for peace and monsters and notifies all players or players opredennyh radius from the property.
  4. The player monsters and the server performing actions form messages or packets
  5. the format of the game messages or pseudo-package
    [player1,player2,server][time_stamp][client/server][geo_location][game_map_location][net_key][player_id][visible_radius]–
    [Player1, player2, server] where each element is an object serrializovanny
    player [actions [[hit, player2, fireball], [run, vector], [rotate, radius]], player [param1, param2], items [item1, item2], message [string, chat], gruops [clan, party], time [time_stamp]
    ]
    If you send messages from the client to the server and create a big package.
    Problems:
  6. Players Synchronization
  7. The client server synchronization
  8. Low speed transmission tcp / upd, low transmission rate clien-server
  9. About all packages must know only the server,
  10. Players are at different distances geographically - which reduces the transmission rate
  11. It is necessary to send packets only to neighboring objects
  12. Packets can be lost, you can replace packages
    Possible solutions at the level of the game:
  13. two-dimensional array [] [] which corresponds to the physical map of the game world
  14. Addition of game objects in this array
  15. Adding a radius of visibility for each object that can send packets
  16. The object sends packets only to objects that are within a certain radius from it
  17. form a group of objects
  18. One of the main objects appointed
  19. Each of the group of objects sends each packet
  20. Create a reference package
  21. The main object of the group sends to all the reference package
    The decision on the network and the server level:
  22. Take the map of the world and creates a two-dimensional array, the cell contains the information about the region [country] [city] and all customers located in the region
  23. These points are calculated and constructed graph the shortest path to each point
  24. a few selected customers in each region with the highest speed
  25. One of the customer becomes a data server for the rest of the region
  26. Servers of the region pass through the chain and posts on the shortest path between a server and up
  27. Customers Starbases bark message timeout
  28. The server creates a stream that forms the message queue
  29. On the main server is created in the same message queue

what do you think?

Online games sync https://habrahabr.ru/post/280720/

http://fursoffers.narod.ru/ lineage 2 protocol

But in all this, do you have an estimation of the max number of bytes each player will send every second? Based on this you can choose if p2p is a viable solution.

Many people have asymmetrical connection with little upload.

Let’s say for example that someone has 70KB/s upload and 700KB/s download.
If, in your game, every player needs to send 10KB/s, with p2p he can handle only 7 players inside his radius, while with a client-server connection he can handle max 70 player in his radius if the server has enough bandwidth.

Can you explain why spidermonkey does not work for you? I am slightly confused. Why are you trying to re-create the wheel? It works perfectly fine, and solves all the problems you have not yet foreseen along the way.

If indeed there is a shortfall in it’s implementation it would be better to build upon it, instead of recreating what is already there.

P2p s nearly always the worst solution there is.

1 Like

If you are willing to properly zamorochitsya, get a minimum (if locally limited movement - is 99% of the time the player), the load on the network due to minor load increase on the players machine (and p2p can later enter for further unloading the server’s network of channels, besides themselves server as similar in logic to customers that is as beautiful are scattered on the geographical location):
customers only transmitted to user actions the server (up to low - pressing buttons on a mouse and keyboard, but it is better of course to determine the events that something changed in the world)
Each client stores information about all objects in their environment and most importantly, all the objects that are required for computing ‘next state’ of objects that can change it
2.a. when you move a player from the server it transmitted information about all the new facilities that fall under this scope (recommended to optimize the download area of ​​objects slightly expand, and send the necessary information in advance but the background, such as setting priorities for the direction of motion data)
2.b. in this way. All clients receive events from all players in their environment (the players in this case, how the same objects in the world but the effect of which can not be calculated, although it is always possible to find a situation where there can be soptimizirovat, for example if the player is sitting on the machine control algorithm - so coordinates can be not send)
Each client calculates the next state based on the data stored in it, virtually all performing the same operation as the server but only the player in the local environment
3.a It can always be part of the critical logic to wrap up on the server side, such as the generation of loot
enter a log of events and states of all objects to rollback them back to playing the incoming events in case some of them time out of sync (for example, the player responded to the actions of other players but this event was late, respectively, roll away steps back and lose with the new speed log states (in fact, the algorithm is not trivial, there may be variations on the theme of events accumulated during the time period or the go-ahead ticker server, if it is to realize p2p newsletter events from the players)
To approach to the choice of tcp / udp protocol carefully, what problems we want - lags or glitches (players will be sausages, the team lost and even a variety of artifacts), also can be a combination of protocols for different types of traffic.
but the technology includes the ability to work correctly with the loss of data (roll away state and rebuilding with new data), so udp suggests itself.
protection against malicious dissynchronization client-server data (when the customer draws their condition object that is incompatible with the server, with an attempt to schiterit) built into the ideology - the user can not change anything in the algorithm, because the server and clients vseravno will see the true picture, not the that cheater himself painted.
6.A. but this algorithm is poorly protected from bots automate actions on the client side - a lot of information, server algorithms and logic - in plain sight, some of the game, with deception players will be difficult to implement (such as here are your stats with the coefficients, you think that the formula dps - simple multiplication and it is three-storey with integrals)

p.s. the algorithm is actually very complex, but the technology is ideal for complex worlds (dynamically changing the player’s actions, such as destroy or change the environment) with a lot of players and logic, the most implemented on the client side (remember, if you overdo it, the bots automation will be very just write)
Переводчик Google для бизнеса –Инструменты переводчикаПереводчик сайтовСлужба “Анализ рынков”
О Переводчике GoogleСообществаМобильная версияО GoogleПравила и принципыСправкаОтправить отзыв

Are you coding a game or a nuclear launcher ?
The idea is very simple: if i play football with someone and this guy just use his hands or drugs, i will not play with him anymore.
The root of cheats (and flame, and toxic community) is that you are trying to be a boss, a chief, who decides who is playing with who. You have kind of the same problem you have with big society, with thief and tax evasion etc.
You can see it the other way around and think of this simple principle that should always be used by open source community: i, owner of my computer, decides what my computer will do.
If i go in a dungeon with a lot of monster and it pisses my off then i should be able to tell to my computer “delete them, i don’t want that”.
You can go further: you play with a friends (in the same bus, neighbourhood ect. it’s what i tried to achieve in a previous game engine) and you go in a cave. Then, you friend decides that there is a lot of monster spitting nukes and throwing lasers with their eyes etc.
If you agree with that, well, it’s ok, you can play with him. If you don’t want it, ask him to don’t do that. If he still wants to do that, then you can either let him fight them alone (and you’ll not see them, nor take damage from them) or you just stop play with that guy.

You probably have this picture from terminator 2 with the 2 boys saying “i shot you first”, “no i did it first” “no, me” (in french it’s like that). There is not perfect solution to that. The server approach means that an adult will sit on a rock and arbiter everything.
But i am not a kid. No one is gonna tell me who is right and who is wrong just as if i was a kid. I am old enough to decide if i want to play with someone or not.

Note that it’s also the best way to avoid trolls, haters, trashtalkers etc. How do you avoid them irl ? How do you avoid them on skype ?
You can avoid them because nobody but you decides who is your friend and who is not.

The server vs p2p is an opposition much deeper than it looks like. It’s political, it’s boss/employees or, the opposite, people working together because they want it, like in open source. It’s internet vs minitel (Minitel - Wikipedia i don’t know equivalent things in other countries), it’s microsoft/apple vs linux, imperialism vs anarchism, transcendence vs immanence …

I am learning, reading, listening conferences, thinking etc on that for years. I could do a thesis on it.
Are you in open source because you don’t have enough money/influence to make proprietary things or are you on open source because you want it ?

Thanks. understand.

what I was advised:
lineage 2 protocol: Lineage II Packets
NIO: Java NIO Overview and simple client server
Source Multiplayer Networking: Source Multiplayer Networking - Valve Developer Community
protobuf: https://github.com/google/protobuf
hexagonal coordinate system

Lmao, no offence intended but when I read your replies I can’t help but think you’re a bot.

Im not bot, I asked questions in different communities and telling about the fact that I was advised.
I think develop online rpg is hard. I think over the architecture.

@JESTERRRRRR was probably referring to your lack of proper grammar.

yes i have band english) I have been programming better than talking :slight_smile:
I think and formulate the basic idea.

hex grid coordinates