Twin Duel/Strategy Guide

From RoboWiki
Jump to: navigation, search
Twin Duel Sub-pages:
Twin DuelParticipants - Results - Strategy Guide - Tourney Runner - Origin Discussion - Archived Talk 20090807


Unlike Melee, there are only 2 enemies that you need to get the positions of. This means that it is almost always more effective to turn the radar back than to continue to rotate the radar for a full circle until you scan an enemy. There are several ways of making optimal radars:

  • Last-scan based: this style of radar should be effective in all Twin Duel settings, although a special case will be needed for when there is only 1 enemy
    • Turn the radar back if the radar turned less than pi radians (180 degrees) since scanning the last bot.
    • Turn the radar back if the last bot was scanned less than 4 'ticks' ago.
  • Enemy collection priority based:
    • Turn the radar in the direction of the enemy that is determined to have the greatest need of being scanned. This is usually the enemy that has gone the longest without being scanned. Be careful to only consider enemies that are still alive, otherwise you may end up scanning empty space! Also be aware that your radar only extends 1200 away from you. This radar has the advantage of being easily ported to Melee.

Additionally, and similar to Melee, it is helpful to scan your target for several consecutive scans prior to firing at them, to let the gun adjust to a good angle. This can be done by switching to a 1v1 style radar if you have a low gun heat.

Because you have a teammate, for 2v2 situations it may be beneficial for each bot to scan a different enemy using a standard 1v1 radar lock, and send the data back and forth using the messaging system. A problem with this method is that the messages are only received 1 'tick' after having sent them, making the receiving bot acting a tick late, and thus slightly less accurate. Because TwinDuel is code size restricted, this technique may not be feasible, worth the code size, or even have any advantage at all due to the 1-off problem.

Choosing a target

There are many ways of deciding which target should be chosen, each with its advantages and disadvantages:

  • Both bots attack the leader:
    • This strategy is used to good effect by GrauwuarG
    • It's main advantage is that once the leader is killed, the other bot loses 30 life. This should either disable it, or at least make it very easy to kill.
    • The disadvantage of this method is that the leader starts with 200 energy, so is harder to kill than its teammate. Also, the leader may be in a position that is harder to hit than its teammate (e.g. further away), so hard-coding to attack the leader may be a bad idea.
    • This method should be coupled with an aggressive movement, so that the leader is easy to hit. The aggressive movement may also expose flaws in the enemy's movement.
  • Both bots attack the non-leader:
    • This strategy's advantage is that it is easier to kill the other bot due to it only having 100 energy to start, and thus get a 2v1 advantage. This helps because the remaining bot (the leader) will find it difficult to move perpendicular to both of your bots, making it easy for at least one of your bots to hit it.
    • The disadvantage is that the non-leader may be further away or moving perpendicular, making it harder to hit, and thus regain energy, than the leader.
    • Like attacking the leader, this targeting method should be coupled with an aggressive movement to ensure that the non-leader is killed before they can pick off your bots.
  • Each bot attacks the closest enemy:
    • This strategy has the advantage of keeping your bots alive as long as possible. It focuses on prolonging your own bots' lives, rather than killing the enemy as quickly as possible. By shooting closer enemies you have a better chance of hitting them, and so get the hit bonus more often. In fact, if you have a hit rate greater than 33%, your energy can actually increase.
    • The disadvantage is that each of your bots can focus on a different bot, and one of your bots then gets killed before you kill either of the enemy bots. This would leave you in a 1v2 situation, where you can't move perpendicularly to either enemy bot, making it much easier for them to hit you.

The best method is all dependent on what style of bot you want. Aggressive bots should both focus on a single bot, either the leader or the non-leader. Passive bots should shoot at the closest bot to avoid missing too often. Other factors, such as which bot has more energy, or which bot is at a less perpendicular angle, can also help you build a 'targetability' factor for a bot.

Another issue is 'thrashing' between the 2 targets. This should be avoided, for 2 reasons:

  • Your gun may not be able to turn in time, and you end up shooting into empty space.
  • You don't focus on killing one bot, and instead inflict a bit of damage to each. This prolongs the time it takes to kill one of the enemy bots, and potentially leaves you in a 1v2 situation.

To avoid thrashing you should only change targets if your enemy's 'targetability' is a certain amount higher than the current target's is. Another option is to only change your target if your gun heat is above a certain level, although this will not help for the latter problem described above.


Two different movement styles have dominated in Twin Duel:

1v1 style Random Movement:

  • This movement style is usually quite aggressive. This is due to the fact that 1v1 style movements are designed to only move perpendicular to one bot at a time, so they get very close to one of the enemies, hoping that only the one enemy (that they are moving perpendicular to) will target them successfully.
  • Various methods of implementing the Random Movement have been tried, from Oscillators to functions that calculate the chance that the bot should reverse this tick. Almost all of the aggressive Twin Duel bots have this type of movement.

Melee style Minimum Risk Movement:

  • This movement style is theoretically superior, because it can take both enemies and the teammate into account. Because there are 2 enemies and one teammate, the following things need to, or should be, taken into account:
    • Moving perpendicular to the enemies:
      • Because you have a teammate, there is a good possibility that only 1 (or none) are targeting a particular one of your bots. You only need to move perpendicular to them if they are targeting you, so be sure to take this into account.
    • Staying away from strong enemies:
      • If you are far away from weak enemies you may miss them until you are out of energy, but if the enemy is stronger than you it is better to back off until their energy is depleted a bit.
    • Staying away from your teammate:
      • If you are right next to your teammate it makes it more likely that the enemy's stray bullets will hit you. You might also get hit with friendly fire.
    • Not getting in between your teammate and the enemy bots:
      • Like above, 'blowby' from the enemy might hit either one of you. Also, you are very likely to get hit by friendly fire.
    • Staying away from corners:
      • Minimum Risk Movement can get stuck in a local minimum that makes it easy to predict if it gets cornered. Some bots capitalize on this (e.g. GrauwuarG), so adding danger to the corners may be useful.
    • Reversing every now and again:
      • Because there is only one enemy, you do need to worry about getting Flat Movement. (In melee you can usually avoid this by making other bots more 'targetable', and thus never being shot at). KomariousTeam tries to do Wave Surfing, but because they can only do this against one enemy at a time, the other enemy has no problem picking them off.
    • Getting in between the enemies, especially in 1v2 situations:
      • This means that any of an enemy's missed bullets have a good chance of hitting the other enemy. This strategy is also useful if you stick the non-leader between the two enemies, and make the leader back off. There is a good chance that your non-leader will be killed, but he will also be able to inflict a huge amount of damage on the other 2 bots (even if he won't be causing a lot of the damage), making them easy for your still fresh leader to pick off.


<To be continued...>

Personal tools