First Person Spectate in Natural Selection 2

Millions of people watch large sporting events such as the Olympics, the World Cup or the Super Bowl. Only a small proportion of them are able to play the sport they are watching with any degree of competence. People enjoy spectating other people while they display skill, courage and showmanship. This phenomenon is becoming increasingly prevalent in computer gaming. Games such as Dota, League of Legends, Starcraft and Counter Strike can and do fill stadiums. Twitch.TV and other game-focused streaming services are bypassing traditional media to deliver viewers the content they way, free of the opinions of network executives.

The neologism ‘eSport’ has come to be somewhat of a buzzword for the games industry. Some games launch with overt eSport aspirations, with developers or publishers paying out significant sums to seed competitive play ecosystems (Think Shootmania). Others don’t receive any official eSport support at all, but develop their own competitive communities on the back of the strength of the game (Think the original Natural Selection).

Natural Selection 2 falls somewhere in between. The competitive community has grown itself, with some matches being played even in the earliest beta releases. The ENSL.org Natural Selection League featured 80 teams of six or more players in its opening season over the northern Winter. Monetary assistance from Unknown Worlds has been targeted but minimal: We paid for the a tournament grand final around launch, and are doing so again for the NSL Invitational Cup. But money is not what matters for competitive play.

The game matters. Specifically, a game’s eSport potential can be measured against three key criteria:

  1. How conducive the game-play is to competitive, skill based play
  2. The degree to which ancillary game systems support organised play
  3. The show the game can provide to spectators

Natural Selection has a history of hitting number 1 on the head. The combination of the depth-of-play of Real Time Strategy with the visceral thrills of First Person Shooter combat is uniquely suited to competition. Of course, balance is an on-going challenge, but the asymmetry of game-play generally adds to its appeal.

Number 2 on the other hand is a total wash. Loading into a game of NS2 is a blast of the old school – No splash screens, login prompts, matchmaking or player tracking. In contrast to the ruthlessly efficient league system of Starcraft 2, our game is an ancillary system desert, and we are developing plans to address this deficiency in the medium term.

What of the show? Thanks to a community member (and later, hire) named Huze, NS2 launched with a spectator system called Insight. Insight allowed spectators to watch games in third-person, free-camera, and over-head (MOBA/RTS style) cameras, see tech choices, player status, resource trends and more. The system allowed the game to be a spectacle, and has served well in countless game-casts. But it couldn’t do what many spectator systems can: First person view.

firstperson_spec1

Until now. Along with an interface redesign and new resource graphing features, the Insight version shipping with the Gorgeous update features first person spectating. The feature was not trivial to implement. When Max set out to create Spark’s networking code, his primary objective was lag free play, not spectators. So the implementation was not trivial, but after some tweaking, thinking and typing, it works.

fpfunction

The system is a trickster. It works by making the spectating player’s client (the instance of the game running on the spectator’s PC) think it is the subject’s client (the instance of the game running on the subject’s PC). The server sends the spectator the same information about the ‘world’ state that it is sending to the player you are spectating. That way, you see their view model and everything else exactly as they see it.

To make this system work, the UI (User Interface) system had to be reworked, and input handling moved from C++ to Lua. This had an interesting tangential benefit: Input handling was one of the last NS2 – specific features being handled in Spark, rather than in Lua. Now, the entire game is in Lua, making it even more moddable.

Natural Selection 2 is of course, like most video games, completely free of bugs. But some (lots) did sneak (barge) into the game after these changes were made. Many of them were caused by transitions. When designing the system, we had to consider what would happen when you are spectating a player that dies, leaves the server, etc. But Brian killed them all.

fpspecgraph

The transition has been a challenge in itself. When the system was initially implemented, users experienced large hitches when switching between players. The hitch is visible in the graph above – The dotted blue line in the ‘PlayerPos’ section shows the relative position of a players view. The five distinct sections represent the viewing of different players in a game. The gap between the last dot on one perspective and the first dot on another is the time taken to switch between perspectives.

The hitches between each one were initially around a whole second. This was very perceptible in game and made the feature feel unpolished and non responsive. By interpolating the predicted path of the first perspective until the spectator received enough network data to establish the second perspective, the hitch could be significantly reduced.

First person spectating will significantly improve the show that NS2 can put on. Those watching games will be able to get closer to the best players, down on the ground in the thick of the action. The feature is new and will no doubt go through many revisions, but having it in is a real thrill.