Cykelero's Projects


captureTheFlag

Introduction

Two teams of three tanks, each one capable of attacking an opponent, destroying a tree or picking up the flag, try to reach the opposition's base to take the flag stored there, and bring it back to their own base.

On their way, they might encounter enemy tanks, which they'll invariably fight, until there is no tank left to fight. Sometimes, they might destroy trees to open new routes, hoping to avoid encounters with enemies and maximize the chances of coming back home alive, with the flag.

The bots have some team behavior that aims to optimize the way they play.
If an enemy takes the team's flag, the bots will automatically pick a role: one will go directly towards the offending enemy, while another will head for the opposing base, in hope of intercepting the flag carrier. If every bot on the aggressed team is alive, the third one will keep on attacking, in order to try to give its team an advantage.

Cinematic interface

In order to make captureTheFlag more enjoyable, I've implemented a few features of which the goal is to make watching the bots more like watching a movie or an actual game.
The top bar displays the current events: a battle, a flag transportation, or merely a bot nearing the enemy base. By default, the more important of these events is focused on by the action camera. The camera will move very smoothly, and pan in and out based on the event being watched.

You can however take control of the camera, removing some or all of its autonomy.
Pressing the space bar will change the current viewing mode, but using the arrow keys will automatically switch from mode one to two.
In mode two, the left and right keys allow the selection of a different event that the more important one, thus permitting a fast overview of everything that's going on, without the need to manually pan the camera.
Additionally, switching to mode three will allow direct control over the camera using the arrow keys, and the viewing angle will widen to accommodate the now slower movement of the view.

Miscellaneous controls

U: Pause game
J: Mute sound
Y: Cycle between the three quality modes

Backspace: Switch to global view
Enter: Hide/show HUD
Space bar: Change viewing mode

Developer mode

As its name suggests, this mode was meant to assist during the development of captureTheFlag, but its functionality may remain interesting, and some bits were created merely for fun.
To enable Developer mode, press Shift-X. You can then disable it pressing X alone; it will persist between relaunches of captureTheFlag.
Please note that on Windows, you must use Control instead of Alt.
You can then use the following commands:

Click: select nearest tank and show its pathfinding results
Shift-click: order the selected tank to go to the clicked location
Space bar: select nearest tank/deselect tank
Shift-W-Q: Destroy selected tank

A-drag: Move tank
Q-drag: Rotate tank

Alt-clic: Relocate blue flag
Alt-shift-clic: Relocate red flag

Down arrow: Show cell passage count
Down arrow-shift: Show bot destroyed count
Right arrow: Destroy all tanks

F: Enable fps counter

Last modified: .
captureTheFlag was made using Flash. It is a game. It has tanks, teams, flags, and an AI.