Networked FPS games are a genre of games that never seem to lose popularity. In this recipe, we'll look at the basics to get a server and multiple clients up and running. We will emulate a server with a persistent environment, where players can connect and disconnect at any time.
We have the benefit of using some of the code generated in earlier chapters. The code we'll use requires some changes to be adapted to a networked game, but it will again show the benefit of using jMonkeyEngine's Control
and AppState
classes.
Good recipes to read up on before this are the previous recipes in this chapter (especially Making a networked game – Battleships, on which the architecture relies heavily) and also the Creating a reusable character control recipe from Chapter 2, Cameras and Game Controls, as we will use a similar pattern here for our NetworkedPlayerControl
implementations. To avoid repetition, this recipe will not show or explain all of the regular...