From eb2d7509e65df74d8bd4e3cb117782028da35ed7 Mon Sep 17 00:00:00 2001 From: dsc Date: Wed, 15 Dec 2010 15:11:11 -0800 Subject: [PATCH] Adds /doc files from the tanks project. --- wiki/ai-challenge.md | 27 ++++++++++++++ wiki/ai.md | 32 +++++++++++++++++ wiki/gameplay.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ wiki/index.md | 5 +++ wiki/notes.md | 19 ++++++++++ wiki/roadmap.md | 8 ++++ wiki/tanks.md | 5 --- 7 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 wiki/ai-challenge.md create mode 100644 wiki/ai.md create mode 100644 wiki/gameplay.md create mode 100644 wiki/index.md create mode 100644 wiki/notes.md create mode 100644 wiki/roadmap.md delete mode 100644 wiki/tanks.md diff --git a/wiki/ai-challenge.md b/wiki/ai-challenge.md new file mode 100644 index 0000000..3aa28d7 --- /dev/null +++ b/wiki/ai-challenge.md @@ -0,0 +1,27 @@ +# The Tank AI Challenge + +Your goal is to design an AI tank which does its best to: 1) stay alive; 2) kill all enemy tanks. + +Rules: +- All tanks have 1hp. +- Tanks shoot bullets. Bullets explode on contact with tanks and other bullets, and bounce once on contact with a wall. +- Each tank can have up to 5 bullets in the air at a time. + +Each tick, you get a bunch of inputs: +- A pathmap of the level (which you can ask whether an area is passable) +- A list of friendly and enemy units (including bullets), each with its attributes (trajectory, position, hp, speed, power, shots, etc) +- Your attributes (position, hp, speed, power, etc) + +Ticks occur 30 times per second. When called, you'll return one action, which can be: +- Move toward (x,y) +- Fire a projectile toward (x,y) +- Do nothing +That is all. + +An AI script looks like a list of ordered (test, action) pairs. The game will consider each test in turn, and the first matching will be the action taken. Here's an example: + +- If there is a bullet that will collide with me in less than 15 ticks, shoot a bullet at its location. +- If there is a bullet that will collide with me in less than 30 ticks, move perpendicular to its trajectory. +- If there is an enemy within 100 pixels, shoot a bullet at it. +- Finally, move toward the closest enemy tank. + diff --git a/wiki/ai.md b/wiki/ai.md new file mode 100644 index 0000000..5f4d6fb --- /dev/null +++ b/wiki/ai.md @@ -0,0 +1,32 @@ +# Tank AI Language + +## Types + +- `Loc`: Object with properties `x` and `y`, representing a position on the map. +- `Rect`: Object with properties `x1`, `y1`, `x2`, `y2`, representing the top-left and bottom-right locations of a region on the map. +- `Agent`: An object that reprensents both your tank and all agents discovered with various lookup methods. See below for properties. + +## Agent Properties + +- `stats`: Agent's stats. + - `hp`: Agent's health. + - `move`: Agent's move speed in squares/sec. + - `speed`: Agent's attack cooldown wait-time in sec. + - `shots`: Maximum projectiles the agent can have in the air at once. +- `loc`: Loc of the top-left point of the agent on the map. +- `boundingBox`: Rect of the agent's absolute map position. +- `midpoint`: Loc of the agent's midpoint position on the map. +- `nShots`: Number of shots the agent currently has in the air. + +## Functions + +- `shoot(x,y)`: Fires a shot at (x,y) if possible. +- `move(x,y)`: Moves directly toward (x,y) if possible. +- `ableToShoot()` -> `Boolean`: Whether your tank is able to fire at the moment. +- `find(x1,y1,x2,y2)` -> `Agent[]`: Returns a list of all agents within the map bounds specified. +- `findNearLike(ticks, filter)` -> `Agent[]`: Returns a list of agents within `ticks` movement distance away that match the filter. +- `findClosest(agents)` -> `Agent`: Returns the closest agent to this tank in the supplied list, or null if none are supplied. +- `willCollide(agents, wiggle)` -> `Agent[]`: Returns the list of agents which will collide with this agent (within `wiggle` width/height pixels). +- `calculatePath(point)` +- `calculatePath(x,y)`: Calculates a path from your current location to (x,y), taking into account walls, and then queues it for future moves. + diff --git a/wiki/gameplay.md b/wiki/gameplay.md new file mode 100644 index 0000000..fd3a511 --- /dev/null +++ b/wiki/gameplay.md @@ -0,0 +1,93 @@ +# The Littlest Battletank + +Inspired by the Tanks minigame in Wii Play. + + +## The Basics +- Your tank has 1hp. +- Your basic cannon shoots bullets. A bullet lives for one bounce or until it kills something. You can have up to 5 bullets at a time in the air. +- When you die, you respawn after a few seconds. (In single player, it restarts the level.) + + +## Controls + +### Desktop Controls + +- Move: wasd, arrows for cardinal directions; combine for 45-degree moves +- Shoot: + - Aim your reticule with the mouse + - Click, or press space to fire a shot +- Items: Press `12345zxc +- Zoom: Mouse wheel +- Customization: + - Keyboard controls can be rebound + - Multiple UI trays + +### iOS Controls +- Move: Trace a path from your tank with your finger +- Shoot: + - Tap once somewhere sufficiently far from your tank to shoot one bullet on a trajectory aimed at that point + - Tap once and hold to see the trajectory line + - Move your finger to drag the line at a new point + - Release the tap to shoot along that trajectory + - Tap with your other hand sufficiently far from your tank and the current trajectory point to cancel +- Items: On-screen buttons, possibly modal +- Zoom: Pinch +- Customization: + - Modal buttons used to switch between multiple UI "trays" with buttons + - Free gestures can be rebound (two/three finger swipe, double-tap, triple-tap) + + +## Gameplay Ideas +- No camera control: camera centers on tank and moves with it, though player can zoom the map +- No number games: all items are qualitative (so, ex: only bosses have more than 1hp, but items (like shields) might absorb damage) +- Allies: companion AI tanks which play for your side (beware friendly fire)- Mutable Environment: obstacles can be destroyed with the right weapons, enemies can be pushed + + +## Items + +### Cannons +- Missiles: Faster projectile, but no bounce +- Refractor Rounds: Slower projectile, but infi bounces +- Shrapnel Rounds: Projectile that splits instead of bounce + +### Heavy Munitions +- Flamethrower: Cone AOE +- Mortar Rounds: Projectile with AOE on detonation +- Proximity Missiles: Projectile that explodes on prox +- Mines: Stationary prox AOE + +### Special Weapons +- Heatseekers: Projectile that will guide around walls to get to your target point, and then explodes even if no one is there +- Nuke: Slow projectile with enormous AOE (reminder: friendly fire) +- Trebuchet Rounds: Projectile which only collides when it reaches its destination (as if it was fired in a parabolic arc) +- Portal Cannon: Makes source/dest wormholes + +### Passives +- Light Ordinance: Faster move, fewer shots in air +- Tactical Driver: Attempts to automatically move your tank out of harm's way when a bullet is imminent +- Chameleon Engine: Makes enemies unable to see you for a limited time, confusing pathing + +### Shields +- Turret Shield: extends 45-degrees around tour tank, centered on the barrel; impact pushes your tank back +- Orbital Shield: small pellet-shield that orbits your tank +- Stationary Shield: stationary shield sphere, passable to tanks but not bullets +- Imprinted Stationary Shield: as the stationary shield, but passable only to your team and not others + +### Consumables +- Cloudpot: Your tank deploys an emergency zeppelin to float quickly from your current position to your cursor. Tank can only be hit by Trebuchet Rounds during that time. +- The Stunna Shocka (EMP Device): Freezes all tanks in place (including you) + + +## Tank Attributes +- Movement: speed, turning speed +- Cannon: cooldown, max in air, recoil? +- Bullets: speed, num bounces, proximity, AOE explosion +- Toughness: hp (Bosses only), shields, resistance to certain classes of weapons + + +## Flavor +- AI makes commentary on situations. "That was close. Sucker." "loool, you always die here." +- Papercraft art style, vector graphics + + diff --git a/wiki/index.md b/wiki/index.md new file mode 100644 index 0000000..b7058d9 --- /dev/null +++ b/wiki/index.md @@ -0,0 +1,5 @@ +# The Littlest Battletank + +A wiki. With love. + +And more!! \ No newline at end of file diff --git a/wiki/notes.md b/wiki/notes.md new file mode 100644 index 0000000..2c03c50 --- /dev/null +++ b/wiki/notes.md @@ -0,0 +1,19 @@ +# Bugs + +# TODOs + +- AI: Lead shots on moving targets +- Config-driven unit-types (name, stats, properties; pointers to behavior scripts, assets) +- Game scoring +- Support touch events (for iPad?) +- Migrate A* code into PathMap + + +# Code Notes +- Replace *2 and /2 with shifts at compile-time +- Clipping will suck (masking is easy -- overflow:hidden) +- Classes should have generalize()-ed version of instance methods on them. + + +# Other Notes +- GA for littlestbattletanks.com: UA-20115336-1 diff --git a/wiki/roadmap.md b/wiki/roadmap.md new file mode 100644 index 0000000..efb4c0c --- /dev/null +++ b/wiki/roadmap.md @@ -0,0 +1,8 @@ +# Littlest Roadmap + +- UI for config system +- Animations +- Items +- Level transitions +- Improve friendly fire of AI + diff --git a/wiki/tanks.md b/wiki/tanks.md deleted file mode 100644 index b7058d9..0000000 --- a/wiki/tanks.md +++ /dev/null @@ -1,5 +0,0 @@ -# The Littlest Battletank - -A wiki. With love. - -And more!! \ No newline at end of file -- 1.7.0.4