User:Balee/CPU Improvement Proposal

From Worms Knowledge Base

Jump to: navigation, search


In my mind, I have pictured two new levels of CPU, ones that I have started calling CPU 6 and CPU X. The latter would/could be a nearly-perfect opponent (emphasis on nearly), while CPU 6 would be, while drastically harder to beat than CPU 5, still far from perfect. Their improved properties would be as followed.

Walking

CPU 6

It would walk normally, but when it's faster to forward jump, it would jump. Maybe if it had Fast Walk, and if the distance where it would want to walk is further than a certain, probably pre-set threshold, it could use it. In case of infinite Fast Walks, it uses them automatically.

CPU X

Same as above, generally, but can flipwalk.

Jumping

CPU 6

Can backflip and small backflip.

CPU X

Same as above, but could use Low Gravity if the jump would require it but only if the attack it wants to do "worths it" (details about what worths it later). If there are infinite Low Gravities, it switches it off after use, and switches it back if it's needed again.

Attacking

Currently, CPU teams tend to attack worms which are closer to them, and so they can be tricket to kill a weaker worm with an easy shot instead of killing a stronger worm with a harder, but still manageable shot.

CPU 6

Attacks piles and stronger worms if possible, considers plopping opponent worms whenever it's easy to do (easy meaning that it can be plopped using any F3 and F4 weapon or bat). Also should avoid hitting itself or other allied worms unless a certain condition in the upcoming damaged is met - for example, if the damage dealt to the opponent team is at least triple of the damage dealt to itself or allied worms, taking drowning strong worms and killing worms into consideration as a positive bias and taking killing own worms into consideration as a negative bias.

CPU X

Same as above, but considers plopping with other weapons as well, such as explosives, projectiles, strikes. If there's no worm selection at the beginning of the turn, can pile one worm with another if the pile will have at least 2 worms whose turn isn't the next one; if there's worm selection at the beginning of the turn, only piles if the pile would consist of more than 2 worms, or if it can make more than 1 piles (eg. with shotgun or bow). Also shouldn't mind killing or damaging allied worms or itself as long as one stays alive, if it can kill the opponent team(s) with the attack. Considers grave damage.

Defending

This is probably the most complex thing to do.

CPU 6

Tries to move underground to be covered from strikes and attacks coming from above, tries not to pile with allied worms.

CPU X

Same as above, but also tries to pile with opponent worms whose turn is not the next one, as well as if the worm is near the edge of the map, it tries to hide in a place where it can't be plopped easily (see above).

Weapon usage

A LOT of weapons are not used by CPU teams, even though some of them are not too hard to use. I'm going to list weapons and how they could be used by them, starting with weapons that could be used by both CPU 6 and X, then continuing with weapons that could only be used by CPU X. I'll also list some modifications to certain weapons which the CPU uses, but could use more effectively.

Both

  • Mortar: Could aim to a nearby wall or ceiling, from which the clusters could fall down on the targeted worm. Since the spawn of clusters is erratic, it should always take an "average" spawn (that is, a homogenous spread) into consideration, something like human players do.
  • Sheep Launcher: Should be able to use it in 2 different ways. 1) If possible, just shoot the sheep at it like a bazooka with zero wind and same strenght, and explode it when it touches the worm or is the closest to the worm. 2) If the sheep needs to walk, do it if the obstacles are not higher than the maximum jumping height of the sheep minus a set amount of pixels (this could either be set to be a standard, or to vary a bit from a standard based on the amount of damage the sheep would cause).
  • Banana: Instead of making it explode near a worm, it could explode above the worm, so the blast doesn't push the worm horizontally, and so it would also be damaged by the clusters. Should only use it if an amount of damage above a set value can be dealt or if the game can be ended with it. Since the spawn of clusters is erratic, it should always take an "average" spawn (that is, a homogenous spread) into consideration, something like human players do.
  • Axe: Use it on high-HP worms or if it can kill the last remaining opponent if it has 1 HP (sort of "Humiliation" thingy).
  • Handgun, Uzi, Minigun: Keep the aim on the originally aimed worm. Try to plop or pile with it if it's possible. If there's a wall on one side of the worm, always attack from the other side unless, of course, there's water or a pile on the other side.
  • Longbow: Use it to pile and to plop.
  • Dragon Ball: Use it to pile and to plop.
  • Prod: Use it to pile and to plop, or to deal fall damage if it will kill the last worm in the opponent's team(s) (sort of "Humiliation" thingy).
  • Sheep: Either drop it onto another worm from a higher ledge, or if the sheep needs to walk, do it if the obstacles are not higher than the maximum jumping height of the sheep minus a set amount of pixels (this could either be set to be a standard, or to vary a bit from a standard based on the amount of damage the sheep would cause).
  • Mail Strike: Seeing how it already can use Napalm Strike effectively, I don't think using Mail Strike would be too much harder.
  • Blow Torch: Use it to open a path to an opposing worm, or to damage and knock it, preferrably to water.
  • Pneumatic Drill: Use it either to knock a strong worm to the water or to a greater pile (perhaps?), and under certain circumstances (for example, if the opponent has 2 worms left and the CPU has 3) if it's possible, drill the opponent worm - and itself - into water under the terrain. Since the amount the drill drills is erratic, the CPU should take the shortest hole into consideration, and add a certain amount of pixels (you could call it "hope") based on the damage it can cause; don't go over a set hole lenght which is still lower than the maximum lenght - that is, don't take "risks".
  • Baseball bat: Use it to plop opponents, maybe in a way that it knocks other worms standing near the edge on a map, exposed.
  • Bungee: Use it to break falls. CPU 6 should only use it if there is land under it.
  • Parachute: Use it to break falls. CPU 6 should only use it if there is land where the wind would blow it and it also can't activate it "manually".
  • Teleport: Use it "better". Currently, it usually teleports out to the open, so instead, it should teleport where it's covered or can't be plopped easily.
  • Super Banana: Essentially, CPU could use it the same way a normal Banana it uses and explode it where a normal Banana would explode by itself, but wait until the clusters are "settled down", and then explode those.
  • Flame thrower: Use it to pile or to plop. If only damage can be dealt, prefer to use it on piles and/or worms with a wall on one of their sides.
  • Sally Army: Perhaps use it as the Old Woman, with the clusters being an added bonus to it.
  • Mad Cow: Maybe one at a time, maybe more, this needs a few conditions. Should always plan by "expecting" them to jump only to their minimum height.
  • Old Woman: Pretty straightforward to use. Should always plan by "expecting" it to jump only to its minimum height.

CPU X

  • Homing Missile: Since the trajectory is really predictable, I think the CPU shouldn't have problems using this.
  • Homing Pidgeon: I guess the trajectory of this one is a bit chaotic compared to that of the Homing Missile, so maybe CPU should only use it when it would hit the desired target, maybe counting with some "acceptable risk" factor as well.
  • Sheep Launcher: Should be able to use it in a 3rd way, which is if the targeted worm is standing on a lower place than the attacker, the worm could fire the sheep to the roof (if there's any) which will then make the sheep lose its horizontal speed and fall down onto the targeted worm. The CPU would explode the sheep on contact or where it "desires".
  • Cluster Bomb, Banana Bomb: Should be able to clusterfuck other worms, since the conditions and method to do that is pretty straightforward.
  • Dragon Ball: Should be able to use this with backflip knock.
  • Kamikaze: Do it only with weak worms, and if the damage dealt to the opponent is above a certain threshold.
  • Suicide Bomber: Do it only with weak worms, and if the damage dealt to the opponent is above a certain threshold, with taking the number of opponent and allied worms being infected afterwards into consideration as positive and negative bias, respectively.
  • Super Sheep: Maybe this could work and wouldn't take too much time to plan if the CPU kept the planned trajectory really simple and short. As a bonus, perhaps during longer flights in the open, it could "randomly" do a circle with it, "for fun".
  • Bungee: Same as CPU 6 but make it be able to do a little swing, maybe in one direction until it reaches the ground, then drop itself.
  • Teleport: Be able to do telecide as well.
  • Parachute: Make it be able to control itself to some extent, maybe only if the control only consists of pressing one or two direction keys during the entire flight. Also make it able to activate chute at will, perhaps even during jumping.
  • Scales of Justice: Use it when the HP moved to allied teams and the HP removed from opposing teams is above a certain amount or if using it would result in certain advantages – for example, if the amount moved isn't too much, but using it lowers the opponent worm(s)'s HP below healthy level or something similar.
  • Indian Nuclear Test: Use it if a considerable amount of opponent worms can be plopped with it or if the game can be drawed.
  • Armageddon: Use it if a considerable amount of opponent worms are higher on the map and there's at least one allied worm buried "well" (what "well" means should be somehow set based on the amount of pixels above the worm or something similar) or if the game can be drawed.
  • Patsy's Magic Bullet: Since this hits its target most of the time, using this probably won't be a problem.
  • Freeze: Use it before the Nuke drops to preserve health. Maybe this could have a margin of error, since the CPU would probably have an advantage at knowing when the nuke will drop.
  • Jetpack: The CPU could plan a short and simple route to its target. Probably could be able to attack from Jetpack and retreat using it as well.
  • Low Gravity: Use it when a jump needs it, but only if it's necessary.
  • Fast Walk: Use it when a lot of walking is needed and optimum jumping would be slower or impossible. Clearly, deciding whether optimum jumping would be slower should be somewhat simple, to avoid thinking too much.
  • Double Turn Time: Use it to think a bit more than usual, and to evaluate attacks that need more time than usual, but of course, keep in mind how much time did the CPU gain when collecting the crate, not only the fact that it collected it.
  • Double Damage: Be able to plan different kinds of attacks when equipped with this, both taking nearby opponents and allies into consideration, as well as running into cover.

Mole, Mine Strike, Mole Strike, Girder, Girder Starter Pack, Skunk most likely can't be used by CPU teams because they usually require human thinking about when to use. Or at least I can't think of ways the CPU could use them. Laser Sight is not needed for the CPU and Invisibility would be useless I guess.

It probably should avoid hitting Oil Barrels on purpose since their effect and use relies on several variables and it might take too much time to figure out a good attacking strategy.

Crates

At all times, it should try and collect crates and Donor Cards whenever it's possible. As for blowing them up, it should probably follow the same "guidelines" as it does with Oil Barrels.

Maybe, for fun, CPU X should check the random seed and time collecting the crate in a fashion that it gets useful weapons. This would make letting crates lie on the other half of the map because it's too much time to collect them a mistake since when the CPU collects it, it would most likely contain something that's potentially powerful.

Scanning and planning

Since I guess both of this would take a lot of time if done pixel-by-pixel and taking every possible shot into consideration, why not:

  • Scan the map for ways to walk and attack and store that information during the human player's turn, and only modify where the terrain changed and rethink the strategy if needed. Think using the state of the map, mines, barrels and worms in the beginning of the turn.
  • Take only a limited number of shots into consideration, and be more focused on the outcome rather than how to get there. For example, if two worms are piled up near the edge of the map, then the CPU should first "decide" on plopping those worms, then consider if walking there would worth it, and go with a simple but effective way to achieve whatever goal it might have. Don't make it think more than it needs.

Rope

Yeah, rope. This really depends on how complex roping would the CPU need. If it only needs it to raise itself up to a ledge or something, I guess it won't be too complex. Maybe some limited swings could be programmed - who knows, it might start roping by itself like how BRS started flipwalking. ;P Also, I guess this would make it able to do the floating weapon glitch.

Other strategies

  • Put a mine or petrol on frozen worms, preferably on the one who's turn will be next.
Personal tools