HistorySeveral years ago, I slapped together a competitive multiplayer game in XNA for a vector-graphics prototyping class at uni. I tried to dredge up those archaic childhood feels of playing tag on the playground, with a slightly more sadistic, competitive twist. Enter
TagNabIt.
In this top-down 'shooter', up to four players would pilot their Asteroids-inspired spaceship around the playing field. One person was always 'it' and their job was to tag another player, who then became 'it'. Everyone else's job was to avoid getting caught until the game timer runs out.
Holding down one of the triggers on your controller would cause you to boost until you let go of the trigger or ran out of fuel. Fuel was restored at a much a slower rate than it was consumed, making boosting a strategic resource. The end result was a lot of really intense dogfights where players would just barely scrape past each other and avoid getting tagged.
This was my first foray into multiplayer game design and the reaction was much better than I expected. I tested it with some close friends and things got very heated very quickly. If there's not already a unit of measurement for tracking the time it takes for a game to elicit inter-player profanity, there really should be. TagNabIt's zero-to-"FUCK YOU!" time was rather low.
Lacking the time and interest to further develop the game and put it on XBLIG, I shelved the prototype and moved on to other projects. Lately that itch to make a competitive couch play game has returned, so I decided to resurrect key elements of TagNabIt and combine them with a technology that's interested me greatly lately:
Voronoi diagrams.
A Voronoi diagram is a collection of cells, each of which contains all of the points in space that are closest to a particular control point in the graph. These sorts of diagrams have a lot of practical applications, especially in the fields of technology that deal with nearest neighbor queries. Surprisingly, I don't think I've ever seen them used prominently in games, with the exception of one of the fantastic visualizers in
Q-Games' PixelJunk 4am and this excellent exploration of
polygonal map generation.
I have a working C# implementation of Fortune's algorithm, which is used to construct the edges of a Voronoi diagram in a reasonably short amount of time. Voronoi diagrams are aesthetically interesting, to me at least, and even more so when they're set in motion. I really like the way a cell's appearance can change drastically with just a small amount of movement. A non-interactive example of a fluid Voronoi diagram is available
here. There's a nearly invisible slider on the left that can be tweaked to increase or decrease the number of points in the diagram.
As an aside, I'm intending to bundle the Voronoi tech and release it as a package on the Unity asset store, so if anyone is interested in previewing and helping test the code before I release it, PM me!
The GameWork in progress - 01.08.2013
Voronoid: King of the Fill is a fast-paced game of dominance that takes place on an intensely dynamic playing field. The game supports 3-4 players, though at the moment there's nothing specific limiting me from increasing the upper bounds, aside from some possible UI restrictions. Unity claims to support up to 11 joysticks simultaneously...
Player movement is about as simple as it gets, with nothing more than a joystick for controlling your character on a 2D plane and an analog trigger which throttles boosting. I'm thinking of mapping all of the other gamepad buttons to a simple 'action' button that executes the equivalent of a half-second boost.
Each player's ship controls a point in the Voronoi diagram. The size of the cell surrounding your ship determines how quickly you progress towards collecting a point. I'll calculate the area of each polygonal cell and divide it by the total area of the playing field, leaving each player with a percentage that I multiply against some maximum point-accumulation speed. Basically, the more pixels that are closest to you and nobody else, the faster you'll gain a point. If you've ever played that carnival game where ten people fire water guns at a target to make their horse reach the finish line first, it's a lot like that.
Due to the way Voronoi diagrams work, each player's cell will be close to the same size (I estimate ~±5% variance across the board, on average), unless a player gets trapped in a corner or surrounded by other players. The more evenly spaced apart the players are, the more equivalent everyone's cells will be. Because of this, I suspect that each match will be very neck'n'neck, with one player winning the match by only a few seconds or so.
To further add to the intensity of things, players can use their ship to boost into other players, shunting them aside and stunning them for a second or two. Shunting another person also results in the attacker stealing some point progress from the defender. The 'winner' of a collision is determined by whichever player is moving faster. If both players are moving at the same speed, the facing direction of each player is taken into consideration. If two players are boosting head on at each other, they will harmlessly ricochet off each other and suffer no penalty. That means the best thing to do if someone comes flying at you is to either get the hell out of their way or meet them head on, both of which are hard to do if you've already spent your fuel and are waiting for it to come back.
For simplicity's sake, those are the two primary gameplay mechanics I'm incorporating. TagNabIt's development proved that there's a lot of depth in the boosting ability and my hope is that overlaying the Voronoi diagram on top of things will round it all out and impose a nice balance between seeking out the 'high ground' and smashing your opponents into oblivion.
DemoI keep the web build up to date as often as possible. You can find it
here.
Updated 01/08/2013 - 1:15AMControlsJoystick (Up to 2 players) or WASD - Move your ship
L/R Trigger or Space - Boost
TasklistThere are still several things I need to do before the game is in a playable, testable state. Right now two players can control their own ships and knock the other two dummy players around on the screen.
Ensure Voronoi graph generates stable polygonal cells
Add 'CalculateArea' method to the Voronoi cell class
Display each player's boost meter
Display total area of each player's cell
Display each player's point tally, plus progress towards the next point
Implement point accumulation over time
Improve player-to-player collision
- Iterate on player ship design
- Placeholder SFX
- Particles?
I'm intending to do all, or most, of the art myself for now. I haven't quite settled on the final aesthetic for the game, and this may be something I pass off to somebody else, depending on how things go.