- Unity 4.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 1003字
- 2025-03-31 04:01:53
Artillery Live!
Artillery Live! (http://www.gamebrew.com/game/artillery-live/play) is one of the many, many iterations of the classic Artillery game mechanic, which is nearly as old as video games themselves. It was also built in Flash, but there's no reason it couldn't be built in Unity using 3D tank models and some awesome exploding particle effects.

The core mechanic: Artillery games share a familiar mechanic where the player sets the trajectory and power of his shot to demolish the enemy tanks. This version also has a wind speed feature that affects the way the tank shells travel through the air. Over time and in other incarnations, the game mechanic evolved into a pull-back-and-release experience, mimicking a slingshot. Other versions have the gun turret automatically angling towards the mouse, and the player holds down the mouse button to power up his shot.
The skin: The Gamebrew version is a classic tanks-and-mountains affair, holding true to the very first Artillery games developed by game development pioneers in the 1970s. These games transformed from text-only titles to primitively illustrated games with pixelated tanks. An obvious alternate skin is to replace the tank with a man holding a bow and arrow (refer to the Bowman series of online games):

Among the more interesting Artillery skins in recent memory is the Worms series, which replaces tanks with teams of anthropomorphic annelids bent on heavily armed destruction, and GunBound, an online multiplayer game where players pilot giant vehicles and mounts into battle. In addition to tanks, GunBound throws animals and mythical creatures into the mix. It could even be argued that the pull-back-and-release slingshot mechanic of Angry Birds is an evolution of the Artillery mechanic.

The feature set: In addition to the core mechanic, the front-of-house features, and computer-controlled players, the Gamebrew version of Artillery offers turn-based multiplayer gameplay. Multiplayer games are a huge topic and deserve a book of their own. Unity does have features to enable multiplayer play. Unity interfaces nicely with out-of-the-box socket server solutions, or any server you decide to write on your own. Multiplayer play is largely outside the scope of this book, but Chapter 12, Game #5 – Kisses 'n' Hugs, has you creating a two-player game with a computer-controlled opponent. If you've never programmed a multiplayer game before, you should know that they come with a universe of headaches all their own! As a general rule, you're better off tackling single-player games if you're just starting out.
The skinny on multiplayer
More and more, gaming is moving from the lonely, isolated hobby of teenage boys in their moms' basements to a pastime that people enjoy in groups, either in person or virtually. Any time you move beyond a single-player experience, you're spending more time, money, and brain power to build the game. Here's a list of multiplayer features in order from the most expensive or difficult to the least:
- Multiplayer, different computers, real-time: Think of an action game such as Quake, where everyone's running around and shooting all at once. Real time is the most expensive to develop because you need to make sure all the computers "see" the same thing at once. What if the computer drops a connection or is slower than the rest?
- Multiplayer, different computers, turn-based, synchronous: Boggle, Battleship, and various card and parlor games fit into this category. You don't have to worry about the computers constantly sending and receiving the right messages multiple times per second, so it's a little more forgiving.
- Multiplayer, different computers, turn-based, asynchronous: Instead of people playing at the same time, their latest turn is sent via a Facebook message or an e-mail. Enabling players to grow old and die between moves really takes the messaging pressure off. The Scrabble-like Words With Friends is a great example.
- Multiplayer, human versus computer: This is a costly option because you have to write code to make the computer player intelligent enough to defeat a human player. The difficulty in doing this changes depending on the type of game. It's easier to program artificial intelligence for a game such as Connect Four than Chess.
- Multiplayer, same computer, human versus human: This is the easiest to do. There's no complicated messaging going back and forth between computers, and you don't have to write artificial intelligence for a computer player. Regardless, it's still more effort to build than a strictly single-player game.
Possible additional features: The Worms series did a great job of iterating on the Artillery concept by adding a slew of additional features:
- Weapons inventories (including the standard-issue bazooka, and the not-so-standard-issue Super Sheep and Holy Hand Grenade)
- Limited or collectible ammo
- Team-based play with turn time limits
- Environmental extras such as land mines, oil barrels, and cargo drops
- Moving and jumping
- Physics-based platforming with the ninja rope
- Cutscenes
- Nameable characters
- Single-player levels
- Unlockable extras
The Worms series is an excellent example of how you can take a simple, fun mechanic, skin it creatively, and go nuts with a bevy of brilliant features. But, the most important thing is to start by building Artillery, not Worms.

Bang for your buck
By far, the Holy Grail of feature development is finding features that are fast and cheap to build, but that give players the most pleasure. Being able to name your team of worms provided untold entertainment. I remember spending a lot of time with one version of the game creating my own custom sound effects for the worms to say whenever they'd blow stuff up. It wasn't too tough a feature for the developers to build, and I almost spent more time customizing my team than I did playing the game!
Note
Build a game, buy a house?
If you think that players only notice the big ideas and the big games with hundreds of people working on them, Artillery offers you a re-education! iPhone developer Ethan Nicholas released a version of Artillery on the iPhone and reported to Wired magazine that he had earned $600, 000 on his game. It's definitely possible to be small and successful.