Tower Defense (Abandoned)
game king-of-the-hill javascript
Anyone is free to take over this challenge and fork as necessary. Just give me credit ;)
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack Internalgame king-of-the-hill javascript
Anyone is free to take over this challenge and fork as necessary. Just give me credit ;)
game king-of-the-hill javascript
Anyone is free to take over this challenge and fork as necessary. Just give me credit ;)
#Tower Defense
(Work in Progress)
#The Challenge
There will be two types of submissions: Defenders and Invaders. These two types ofTwo submissions will face offcompete against each other.
The playfield is a 1-dimensional "grid" that is 100 spaces long. Towers can be placed along this playfield, which will do damage to invade the invader that is farthest along within its rangeother player's village without being invaded themselves. Both sidesThey will become stronger between rounds. The game ends after 100 invaders have made it through the defender's playfieldability to place towers, upgrade them, and spawn invaders to attack the enemy village.
The game will be simulated deterministically in a turn based fashion. Invaders cannot pass through each other and only one can be on, with each space. They move forwardplayer being able to do one spaceaction each turn, if possible, resolved farthest-along-first.
Sandbox Note: some experimentation is going to be done on symmetric submissions where each side controls a defender-invader pair.
##Defenders
The objectivegame board is made up of the defendertwo paths, each 100 spaces long. Each player begins with 500 gold, which is used for building towers and spawning invaders; and 100 life. Your objective is to last as manybring your opponent's life down to 0. If neither player has been defeated after 100000 turns as possible, the winner will be the player with the most life at that point, with ties being broken by keeping invaders from getting acrosswho has the playfieldmost gold at that point. If, somehow, there is still a tie, the match will be considered a tie.
At the beginning of the gameEvery 10 turns, the defenderplayers will have 50receive gold. They have the following options available to themInitially, each costingthey receive 10 gold:, but this amount increases by 3 every 100 turns.
power + 1. They will not fire at invader that is currently stunned.Each time you successfully get an invader through your opponent's defenses, your income increases by 1 and you receive a portion of your income proportional to how much HP the invader had left.
There is no set upper bound on power or rangeEach time one of your towers defeats an invader, you receive gold. (Though expanding range beyond the boundaries of the playfield is pointlessMore on that below)
Only one building can be placed on eachEach space on the path can house one tower. When a building is placed or upgradedThere are 3 types of towers, it cannot fire or be upgraded forwhich have a range and a power. It takes 10 turns. Buildings may also be removed for a tower to regain half the gold invested into thembe ready after it is built.
Towers can be upgraded either with a wider range or an increased power, in increments of 1 Gold is earned once every 10 turns.
One action may There is no hard limit to how many times a tower can be taken each turnupgraded.
###Range
Building rangeRange refers to the number ofhow many spaces on either side ofaway from the buildingtower that can be reached by the turrettower's abilities. A range of 0 means that only the space that the tower is on is affected by the tower's attacks.
... | | |A| | | | |B| | | | ... ... 5-4-3-2-1-T-1-2-3-4-5 ... Power has a different meaning depending on the kind of tower.
A turretEach turn, turrets fire at the invader within range that is represented by T and there are invaders A and Bfarthest along the path to your village. IfThey deal damage equal to the turret hadtower's power.
Turrets begin with a range of 0, it would only be able to1 and a power of 1.
Stunners fire at the space immediately in front of it. If it had ainvader within range that is farthest along the path to your village. However, instead of 2dealing damage, it would be able to reachthey stun the invader B only. If it hasfor a rangenumber of 3, it would be ableturns equal to reach boththe tower's power. After firing, stunners cannot fire again for their power + 1 turns. Stunners will not fire at invaders A and Bthat are already stunned.
##InvadersStunners begin with a range of 0 and a power of 3
The objective of the invadersWhen an invader is to get 100 invaders throughon the playfield insame space as fewthe bomb tower, it triggers and deals damage equal to its power to all invaders within its range. After being triggered, it cannot fire again for another 5 turns as possible.
The invaders start outBombs begin with 0 gold. Every 10 turns, some amounta range of gold is earned. The amount earned every 10 turns starts at 10 gold2 and increases by floor(log10(turnNumber) - 1) every 100 turns.a power of 2
You are limited on the maximum stats. You start off unable to boost stats, but every 100 turns, the maximum increases by floor(log10(turnNumber))5
There can only be one invader on each space of the board and invaders cannot pass through each other. You cannot spawn an invader if there is already an invader on the first space of the board. Therefore, a potential counterplay from defenders to prevent massive hordes of invaders is to put stunners on the first few spaces.
To ensure that even the most basic invader AIs will eventually overwhelm defenders (assuming they actually spawn invaders), a multiplier on HP will be applied which exponentially increases by 10% every 10,000 rounds. (HP will still be rounded down to the nearest integer)
Both the Defender and Invadersplayers will have complete knowledge about the state of the game and will be allowed to maintain state from the beginning of the game. They may not directly modify the game state. Any attempts to do so will be disqualified as will any attempt to obfuscate such an attempt.
AIs must return their desired action in less than 1510 milliseconds, averaged over 100 turns. Invalid actions returned by the AI will be ignored.
All submissions will compete against all other submissions in a round-robin tournament. The bot that wins the most matches is declared the winner. In the event of a tie, the number of turns it took to win will be totaled for all winning matches with the smallest cumulative turn count to victory wins. In the unlikely event of a further tie, the turns to loss will be totaled for all losing matches and the bot with the highest cumulative turn count to loss wins.
Only one submission per user can be scored in the round-robin tournament.
Each Defender will face off against each Invader, excluding pairs with identical authors. The number of turns the defender lasted will be averaged across all opponents and that will be its score.
The Defender with the highest score and the Invader with the lowest score will be the winners.
#Tower Defense
(Work in Progress)
[Picture will go here]
#The Challenge
There will be two types of submissions: Defenders and Invaders. These two types of submissions will face off against each other.
The playfield is a 1-dimensional "grid" that is 100 spaces long. Towers can be placed along this playfield, which will do damage to the invader that is farthest along within its range. Both sides will become stronger between rounds. The game ends after 100 invaders have made it through the defender's playfield.
The game will be simulated deterministically in a turn based fashion. Invaders cannot pass through each other and only one can be on each space. They move forward one space each turn, if possible, resolved farthest-along-first.
Sandbox Note: some experimentation is going to be done on symmetric submissions where each side controls a defender-invader pair.
##Defenders
The objective of the defender is to last as many turns as possible by keeping invaders from getting across the playfield.
At the beginning of the game, the defender will have 50 gold. They have the following options available to them, each costing 10 gold:
power + 1. They will not fire at invader that is currently stunned.There is no set upper bound on power or range. (Though expanding range beyond the boundaries of the playfield is pointless)
Only one building can be placed on each space. When a building is placed or upgraded, it cannot fire or be upgraded for 10 turns. Buildings may also be removed to regain half the gold invested into them.
1 Gold is earned once every 10 turns.
One action may be taken each turn.
###Range
Building range refers to the number of spaces on either side of the building that can be reached by the turret.
... | | |A| | | | |B| | | | ... ... 5-4-3-2-1-T-1-2-3-4-5 ... A turret is represented by T and there are invaders A and B. If the turret had a range of 0, it would only be able to fire at the space immediately in front of it. If it had a range of 2, it would be able to reach invader B only. If it has a range of 3, it would be able to reach both invaders A and B.
##Invaders
The objective of the invaders is to get 100 invaders through the playfield in as few turns as possible.
The invaders start out with 0 gold. Every 10 turns, some amount of gold is earned. The amount earned every 10 turns starts at 10 gold and increases by floor(log10(turnNumber) - 1) every 100 turns.
You are limited on the maximum stats. You start off unable to boost stats, but every 100 turns, the maximum increases by floor(log10(turnNumber))
You cannot spawn an invader if there is already an invader on the first space of the board. Therefore, a potential counterplay from defenders to prevent massive hordes of invaders is to put stunners on the first few spaces.
To ensure that even the most basic invader AIs will eventually overwhelm defenders (assuming they actually spawn invaders), a multiplier on HP will be applied which exponentially increases by 10% every 10,000 rounds. (HP will still be rounded down to the nearest integer)
Both the Defender and Invaders will have complete knowledge about the state of the game and will be allowed to maintain state from the beginning of the game. They may not directly modify the game state. Any attempts to do so will be disqualified as will any attempt to obfuscate such an attempt.
AIs must return their desired action in less than 15 milliseconds, averaged over 100 turns. Invalid actions returned by the AI will be ignored.
Each Defender will face off against each Invader, excluding pairs with identical authors. The number of turns the defender lasted will be averaged across all opponents and that will be its score.
The Defender with the highest score and the Invader with the lowest score will be the winners.
Two submissions will compete against each other to invade the other player's village without being invaded themselves. They will have the ability to place towers, upgrade them, and spawn invaders to attack the enemy village. The game will be simulated deterministically in a turn based fashion, with each player being able to do one action each turn.
The game board is made up of two paths, each 100 spaces long. Each player begins with 500 gold, which is used for building towers and spawning invaders; and 100 life. Your objective is to bring your opponent's life down to 0. If neither player has been defeated after 100000 turns, the winner will be the player with the most life at that point, with ties being broken by who has the most gold at that point. If, somehow, there is still a tie, the match will be considered a tie.
Every 10 turns, players will receive gold. Initially, they receive 10 gold, but this amount increases by 3 every 100 turns.
Each time you successfully get an invader through your opponent's defenses, your income increases by 1 and you receive a portion of your income proportional to how much HP the invader had left.
Each time one of your towers defeats an invader, you receive gold. (More on that below)
Each space on the path can house one tower. There are 3 types of towers, which have a range and a power. It takes 10 turns for a tower to be ready after it is built. Towers can be upgraded either with a wider range or an increased power, in increments of 1. There is no hard limit to how many times a tower can be upgraded.
Range refers to how many spaces away from the tower that can be reached by the tower's abilities. A range of 0 means that only the space that the tower is on is affected by the tower's attacks.
Power has a different meaning depending on the kind of tower.
Each turn, turrets fire at the invader within range that is farthest along the path to your village. They deal damage equal to the tower's power.
Turrets begin with a range of 1 and a power of 1.
Stunners fire at the invader within range that is farthest along the path to your village. However, instead of dealing damage, they stun the invader for a number of turns equal to the tower's power. After firing, stunners cannot fire again for their power + 1 turns. Stunners will not fire at invaders that are already stunned.
Stunners begin with a range of 0 and a power of 3
When an invader is on the same space as the bomb tower, it triggers and deals damage equal to its power to all invaders within its range. After being triggered, it cannot fire again for another 5 turns.
Bombs begin with a range of 2 and a power of 2
You are limited on the maximum stats. You start off unable to boost stats, but every 100 turns, the maximum increases by 5
There can only be one invader on each space of the board and invaders cannot pass through each other. You cannot spawn an invader if there is already an invader on the first space of the board. Therefore, a potential counterplay from defenders to prevent massive hordes of invaders is to put stunners on the first few spaces.
Both players will have complete knowledge about the state of the game and will be allowed to maintain state from the beginning of the game. They may not directly modify the game state. Any attempts to do so will be disqualified as will any attempt to obfuscate such an attempt.
AIs must return their desired action in less than 10 milliseconds, averaged over 100 turns. Invalid actions returned by the AI will be ignored.
All submissions will compete against all other submissions in a round-robin tournament. The bot that wins the most matches is declared the winner. In the event of a tie, the number of turns it took to win will be totaled for all winning matches with the smallest cumulative turn count to victory wins. In the unlikely event of a further tie, the turns to loss will be totaled for all losing matches and the bot with the highest cumulative turn count to loss wins.
Only one submission per user can be scored in the round-robin tournament.