2
\$\begingroup\$

I'm writting a C++ server and a C++ client for a rpg game.

The client is using OpenSceneGraph for rendering the 3D. RakNet is used for communication between the client and server.

At this time, the client and the server can communicate together. I have installed bullet for physics, but I didn't added bullet to the server nor the client.

The first reason is because I would like to know what you think about my idea to put the whole physics on the server and just sending to each clients, the updated quaternions for all actors view by each clients.

My second problem is, I never really used bullet, moreover never with a 3D engine. And I don't know if I need to build a scene graph on the server, or if I have to use another strategy. More precisely, most of such games seem to use a database. I using sqlite in some other C++ projects, so I don't have some question about that, but only about the fact that I never wrote a scene graph, so the question is, should I wrote one database scene graph ? or use a scene graph in memory and using a database to save the whole scene graph ? if so, should I do that every frame ?

\$\endgroup\$
  • \$\begingroup\$ Clients could be allowed to "bullet" and communicate the results with each other and the server. If the server agrees with both clients about what happened, there is nothing for the server to do except +1 someone's score. If there's a dispute, the server wins. Use the clients as a "cloud". \$\endgroup\$ – Jon Apr 4 '15 at 19:49
  • \$\begingroup\$ @Jon interesting idea, I'm asking myself if I don't use a trinomial of clients to compute physics. To do so, each client would have two instances of bullet (two scenegraphs too ?), one for itself and a second for another client. When physics are computed, I could maybe try to generate a cheksum and compare results on the server. So if all match, no problem. If one side client and the actual client match, I would accept the actual client computation. If the two sides clients match, send the result to the actual client from a side one. If all computation don't matching, force to disconnect them! \$\endgroup\$ – The Unholy Metal Machine Apr 5 '15 at 1:47
  • \$\begingroup\$ @Jon if you know some internet or book resources about your idea, I would be happy to check that :) \$\endgroup\$ – The Unholy Metal Machine Apr 5 '15 at 1:55
  • \$\begingroup\$ I have no resources to link, unfortunately. I think of it in terms of sports with the server being the referee. You can, more or less, count on the players to behave and play within the rules. When a foul happens, the ref can't always see and the fouler tries to deny it, but the foulee always sees and usually says something. Rather than everyone computing everyone, just have everyone mind their own business, but dynamically include and verify hostile player calculations when appropriate. \$\endgroup\$ – Jon Apr 5 '15 at 2:32
  • 1
    \$\begingroup\$ I've just started reading this : gafferongames.com/networked-physics/… \$\endgroup\$ – The Unholy Metal Machine Apr 5 '15 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.