CLOSED to competing entries
New bots are welcome but are not part of the main competition and probably won't be officially tested.
You stand on a dusty stretch of code, watching the other programs stare at you. Will they shoot? How much ammunition do they have left? All you know is that you want to be the last one standing.
Before the Game
You will be given 10 points to distribute between HP, Dexterity, Armor, and Speed. You may distribute up to 10 points between these categories (integer amounts only). You may put 0 points into a category.
- Your HP will equal 10 plus the number of points you put in HP.
- Your Dexterity (chance of dodging a hit) is equal to 0.04 times the number of points you put in Dexterity. For example, if you put 8 points in Dex, you would have a .32 chance of dodging a hit.
- Your Armor (chance of taking 1 less damage from a hit) is equal to .1 times the number of points you put into Armor.
- Your Speed is simply equal to the number of points you put in Speed.
- You always start with 2 ammo.
This game is turn-based. Agents will be ordered based on their speed, with ties being broken at random before the game begins. Each agent will take their turn, choosing one of the three move options and executing it, then the next player will go. Unlike many KoTHs similar to this one, moves are NOT all executed at the same time.
On each agent's turn, there are three possible moves:
- Heal: If not at maximum HP, gain 1 HP.
- Reload: Gain 2 ammo.
- Shoot: Choose another agent. That agent rolls for dexterity (creates a random real, and wins the roll if their dexterity is higher). If they win the roll they dodge and take 0 damage. Otherwise, they roll for armor. If they win, they take a random amount of damage from 0 to 3, while if they lose, they take a random amount of damage from 1 to 4. All damage is integers.
Once an agent's HP is less than 0, it is out and can no longer take actions. Last agent surviving wins the round.
Each round, if there were X agents, your agent receives X points for each agent below it, plus an extra 2 points if they win. Therefore, in a 10 player game, the top agent would get 11 points, the second would get 8, and so on. As long as all the agents run fast, I should be able to run thousands (maybe hundreds of thousands) of tests, so the scores should be well-distributed. All scores are divided by the number of rounds played for ease of use.
All players will create a class which extends PlayerClass. As an example, you can look at any of the four (non-competing) bots created in the github. Each bot will have a class constructor which initializes the stats picked earlier and a
makeMove() function, which determines what action to take and who is the target.
For input, you have access to the following functions:
- getHP() (gets current HP)
- getAmmo() (gets ammo amount)
- getMaxHP() (gets your max HP)
- getDex() (gets dexterity)
- getArmor() (gets armor)
- getSpeed() (gets speed, you MAY call this on other players)
- getPlayers() (gets list of all players)
- getShotAt() (gets the PlayerClass object who you shot at most recently)
- getShotBy() (gets the PlayerClass object who shot at you most recently)
- getAliveEnemies() (gets a list of all players who have 1 or more HP and are not you)
- deadQ() (gets whether a player is dead, you MAY call this on other players)
- compareTo(PlayerClass p) (gets p's speed minus your speed)
- getWhoShotYou()(gets all bots who shot you (in a random order) since the last time you called the move() action)
The lists of players (getPlayers and getAliveEnemies) should be in turn order, so that allows you to check who will shoot next and/or solve ties in speed.
Rules for Bounty
If, at the end of the challenge (May 6, 20:00 GMT), the current winning bot is in the lead by at least 1 point AND in no way targets specific bots/acts differently based on the bots it faces, that bot will be given the bounty.
Otherwise, if a bot posted after the bounty satisfied this condition at one point, the most recent bot to do so will receive the bounty.
If no bot ever managed to meet the required conditions, the bounty will be awarded to the winner of the KoTH.
You may NOT delete bots you submitted previously to make your bot perform better. If you will delete a bot, I recommend deleting one of your worst ones.
As an example, Destroyer would currently meet the no-targeting requirement (since it simply shoots the first bot in the turn order), but only is leading by around .6 points, so doesn't meet the point requirement.
Submissions in Java only. As long as the submission is simple enough, I might be able to translate from pseudocode/some other language to Java though.
You may only enter 5 bots at any one time, and your bots may not collaborate. Feel free to submit more than 5, but when you submit a new one, set another one as noncompeting.
You MAY design your bots to target specific bots and/or predict what they will do, as long as it doesn't massively help your other bots.
No calling any methods of other entities, except for the ones called out above. The biggest problem here is
takeDamage(), which has to be public so it can be called when someone is shot.
No redefining any functions/variables of PlayerClass besides
The subclass constructor must be of the form
super(x,y,z,a); and cannot overwrite the requirements in the PlayerClass constructor (for example, allowing yourself to spend more than 10 points).
Feel free to define other methods of your class and/or create variables for memory purposes. Between each game, your bot will be reset, so it will only affect each individual game.
Don't make your code take forever. This KOTH is pretty lightweight, so there shouldn't be a need for complex algorithms.
Leaderboard (FINAL STANDINGS)
ChargeBot->0.10870789129210871 SmartBot->1.151028848971151 Tank->3.4236785763214237 RageBot3->3.693295306704693 OneVsOneMeBro->3.7322532677467324 FriendlyAndHealthyBot->5.668694331305669 HpKing->7.525759474240526 FriendlyNotFriendlyBot->7.694217305782694 WinnerBot->8.004405995594004 NormalBot->8.276454723545276 Destroyer->8.732566267433732 StrategicBot->8.91998708001292 Dexter->9.556512443487556 WhatABot->10.622109377890622 FocusFireBot->10.945748054251945
FocusFireBot takes the victory!
The controller and all current agents can be found here: https://github.com/romanpwolfram/GunfightKoTH/tree/main
Challenge name by tjjfvi.