On a Collapsing Platform
Rules
In this KoTH, your task is to not die. It seems simple, right? Well, no.
You're on a platform. A giant platform, of size 100 * (entries) ^ 1.1
units across (this may change if we get a lot of entries). And every few turns, a random tile is removed. As well as this, you, not a small mass in the scale of things, can cause a tile to fall down. Let me explain how this works.
You (the entrant to this KoTH) control a certain number of bots. You (the bots) can then move around on the platform and try not to die. You (still the bots) can move up to 10 units away at base, and can see up to 100 units away (units will be called u from now). However, jumping over a hole costs 2u more, meaning that the largest gap you can clear is three units (3 * 3 for the gap and 1 to land). Do not try and clear 4u+ gaps; you will die. Going off the edge of the platform also is an unwise choice - you will die.
By "you - not a small mass in the scale of things", I mean to say that every step you take takes you closer to your inevitable death - each tile you step on has a hidden durability stat, that will not be revealed to you during the course of the round. When it hits 0, the unlucky bot (hopefully not you (the bot)) on it will be removed with the tile. Do not do this; you will die.
Your weight is a random stat that is decided at the start of your game, and is subtracted from a tile's durability each time you step on it (weights are 150 at base, and durability values in the range of 15000 - 45000 * (entrants) ^ 1/2
, or 15000 * 1-3 * entrants ^ 1/2
, so it only becomes an issue in the long term, or when a lot of players exist.) Do not forget about this and start camping on the same 10 tiles on the end; you will die.
Everything takes place on a tick system - every 10 ticks, you can do an action (subject to change to 20ish if this is exploitable) and this may well be the most important part of the game - reduce it at all costs - the fewer ticks you waste, the less durability you take off, and the longer you can thread the needle between life and death. Do NOT, and I mean NOT in caps, forget about this - you will die.
There are a few items that you can get that will improve your chances and delay your inevitable death represented by these characters:
-
: Removes 1-7% of your weight (or 1-7, whichever is lesser)
=
: Increases your speed by 1 (at 13, this will in fact, prove me wrong and let you clear 4u jumps - still not got the + though).
?
Increases vision by 5 (allowing you to see 5 more blocks in either direction.
>
Reduces your tick delay by 0.1 or 1% of your tick rate, should it drop below 5 (however, before that, you will die most likely.)
+
Duplicates the bot - you start with 10 bots, and each bot left over at the end is worth 10 000 points (1 per tick survived), so this can, effectively, give you 10 000 points free.
Every 10-25 turns, a random platform is removed - unless necessary, this will not drop any bots - the platform chosen will always be empty (just so people don't get unlucky and die at turn 85) unless it is forced not to be - for example, in the endgame, where there is only 10 tiles left. Do not forget this; you will die
Input and Output
To begin with, you will get a string such as this
0, 111, 132, 122, 133, 211, 201, 212, 233, 310, 323
, where:
The first number represents your unique player id, known as PID in the it gang. Then, you get 10 numbers, representing your bots' start positions.
Then, for each turn, for each bot that did not die, you (the player) get a string such as this (shortened to save space):
.___.+>-__u__...+>+-_._
representing the bot's vision.
You must then return an integer, representing how many units you wish to move forward (negative is backwards) (and do not forget that spaces take 2u more, or you will die.); do not try and move more than your speed, or it will be modulo-ed. Errors and invalid input return 0. Note, spaces are represented with .
, in the examples and in game.
Helper functions (to delay your death, hopefully until the end):
info()
: gives you a chunk of info, in this format:
PID: 0
Bots: 11
Score: 10000
[
BID: 1
Weight: 97
Speed: 12
Tick Delay: 8.8
Vision: 110
Pos: -932
Score: 830
]
[
BID: 3
...
]
The string is format as such:
position()
: gives a position of every bot, ordered by their bot ID, or BID (again, only for the it gang).
position(ID)
: gives the x position for a bot with a specific ID. If that ID has died already, it will return "Dead" - plus the space where it died. If that bot never existed, it will return None
.
tickdelay(), weight(), speed(), vision(), tickdelay(ID), weight(ID), speed(ID), vision(ID):
Does exactly what it says on the tin, returns that specific stat for all bots if no ID is given, or the one with that ID should it be given (again, if the bot is dead, it just returns its stats on the turn it died, and if it never existed, it returns None
. Make of it what you will).
vision(ID)
Gives a specific bot's vision - this is useful for sketching a map of the world in conjunction with position(ID)
. Note that other bots are represented as s
, so if you're lucky enough to get your bot (u
) in between two opposing bots (s
), feel free to laugh.
You are allowed access to ALL the random functions (apart from random.seed()
, however I will use a set of predetermined seeds in a random order to facilitate retesting. There will be a large number of trials done - this is just to aid improvements if you so desire to make them.
Bots can store variables and write to files, but ONLY in their directory. I will find any bot who does this and ban them.
Scoring
Bots gain 1 point for each turn they survive, increasing by 1 every 100-200 turns. This will be notified with the string Score/turn increased by 1
. Every powerup gives +500, except for +
, which duplicates the bot, including its score, thus adding its score to your total. At the end, when there is three or fewer tiles left, you gain 10000 + the bot's current score for each bot left alive. This is done for every bot that lives, so people getting 2 or more bots through gain more than those getting 1, and two opposing bots can both get points for their team.
At least 10000 games will be run per round (subject to change), each time resetting all the stats to the base, rerolling RNG and restarting from the beginning.
After as many rounds as I can get through on my PC, the scores will be added up, and the winner gets an accept.
Meta
Help with a Python controller would be appreciated.
Any specifications need to be made?
Should I edit any formulae?