Multiplayer Template

Top  Previous  Next

Multiplayer programming can get to be quite complex; this is why I have asked Felix Pohl, one of Gamestudio's top multiplayer programmers, to get involved and help me with this project.


He kindly accepted my proposal, so we will hopefully end up having a multiplayer template that runs faster than my old template and has more features. Here's what's implemented in the current template version:


- Create dedicated servers or server / client computers;

- Connect to a server as a LAN or an online client. Retrieve and synchronize game status;

- Simple, client-sided first person camera and player movement;

- Synchronized player movement with low-bandwith position and angle updates, primarily achieved via player input synchronization;

- Client controlled and non-controlled characters use the same movement code. The native dplay entity update mechanisms are (mostly) unused;

- A simple yet effective additional interpolation and (position) correction algorithm to avoid out-of-sync situations;

- Three different weapon types. Press the [1],[2],[3] keys to change them;

- Instantaneous shots via c_trace for regular guns;

- Fast projectiles which fly in a straight line via locally created entities (and c_traces), for plasma guns, etc;

- Synchronized entity based weapons for grenades or heat-seeking missiles. It's the first version of the code for this weapon, so there's room for optimization;

- Simple health, damage and respawn code;

- Chat system. Player names are a bit buggy, but they will be fixed in a future version;

- The angles are compressed into a single skill, which almost halves bandwith usage;

- The chat is implemented via send_data.




As you can probably guess, this template version is not configurable yet; still, the network code is pretty solid and can be used for your own projects.


Many things will change in the future versions of the template (especially the code inside mp_main.c) but I am pretty sure that we will end up having a great multiplayer template in our hands.