Difference between revisions of "Strategies"

From Gladiabots Wiki
Jump to: navigation, search
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{Information|This page needs improvement, you are welcome to contribute.}}
 
{{Information|This page needs improvement, you are welcome to contribute.}}
  
== Useful discussions ==
+
== Best practices for AI design ==
 +
 
 +
Some best coding practices from software development also apply to AIs in ''Gladiabots''. The following rules can help improve the quality of AIs, enhancing both the initial development and subsequent maintenance of the AI.
 +
 
 +
{{InformationCollapsed|1=Divide and conquer.|2=Break down a problem into two or more sub-problems and solve each of them separately. Complex sub-problems can again be divided. In ''Gladiabots'' this could be done by creating sub-AIs for each sub-problem. The complexity is reduced leading to a better maintainability.}}
 +
 
 +
{{InformationCollapsed|1=Readability first.|2=AIs are written once, but read many times. Overlapping nodes, links crossing each other and great distances between linked nodes are difficult to read and should be avoided. AIs should have meaningful names revealing their purpose. One should consider to align nodes to the grid.}}
 +
 
 +
{{InformationCollapsed|1=Don't repeat yourself.|2=Avoid using the exact same set of nodes in several places. Sometimes duplicate nodes can be prevented by using bot specific filters or additional conditions. If its not possible to prevent duplicate nodes in the first place one can try to move them to sub AIs.}}
 +
 
 +
{{InformationCollapsed|1=Keep it simple.|2=The size of an AI has a significant effect on the error rate. A simple solution should be preferred over a complex one leading to the same or very similar results. One should ask the question: "Has this AI been implemented with the least amount of nodes necessary?". The more complex the AI is the more likely it is to be buggy.}}
 +
 
 +
{{InformationCollapsed|1=Test, test, test.|2="If debugging is the process of removing bugs, then programming must be the process of putting them in." (Edsger Wybe Dijkstra) As no developer is perfect, new nodes should be tested and debugged right after they were added.}}
 +
 
 +
== Useful resources ==
  
 
* In general, it is recommended to check the [https://forum.gladiabots.com/index.php forum] sections <i>Questions</i> and <i>Strategies</i>. Also "old" topics can give nice information. Another place where tactics are shared are the chat groups on Discord and Telegram (see forum [https://forum.gladiabots.com/viewforum.php?f=12 links]).
 
* In general, it is recommended to check the [https://forum.gladiabots.com/index.php forum] sections <i>Questions</i> and <i>Strategies</i>. Also "old" topics can give nice information. Another place where tactics are shared are the chat groups on Discord and Telegram (see forum [https://forum.gladiabots.com/viewforum.php?f=12 links]).
 
* [https://forum.gladiabots.com/viewtopic.php?f=3&t=823 Shared ideas how players approach the game] (several strong players, at least strong for the first half of 2017, contributed to the topic)
 
* [https://forum.gladiabots.com/viewtopic.php?f=3&t=823 Shared ideas how players approach the game] (several strong players, at least strong for the first half of 2017, contributed to the topic)
 +
 +
<!--
 +
 +
Game mechanics
 +
Bot programming
 +
 +
* Wiki itself
 +
 +
* [https://forum.gladiabots.com Community forum]
 +
* [http://roadmap.gladiabots.com Roadmap] [[Changelog]]
 +
* [https://stats.gladiabots.com/ Gladiabots stats]
 +
* [http://gladiabots-stats.info.tm/ Unofficial Gladiabots stats]
 +
* [https://cmrichards.github.io/glad_simulation/ Unofficial Gladiabots simulator]
 +
* [http://telegram.gladiabots.com/ Telegram chat]
 +
* [http://discord.gladiabots.com/ Discord chat]
 +
 +
 +
played games itself
 +
 +
 +
 +
* Currently targeted / Retreating / Attacking / Scoring / Pushing / Decorators / Ideas worth implementing
 +
* Assault specific strategies / Shotgun specific strategies / Machine gun specific strategies / Sniper specific strategies
 +
** [https://forum.gladiabots.com/viewtopic.php?f=22&t=126&p=4470#p4470 decorators]
 +
** [https://forum.gladiabots.com/viewtopic.php?f=3&t=605 Grand Master League Bot]
 +
** [https://forum.gladiabots.com/viewtopic.php?f=3&t=647 Ultimate AI for beginners]
 +
 +
what are the most important things to implement for new players? (A little bit more explaining text or a link appreciated)
 +
would you provide HQ screenshots of standalone implementations of the main idea of the strategy?
 +
 +
1. Retreatment.
 +
2. Gathering resources.
 +
3. Cooperation.
 +
 +
Smuggling (catch in mid battle)
 +
Rushing (catch at first)
 +
Pushing (we all know)
 +
Dancing (both resource and range based)
 +
Arena Positioning System (using bases and Bots and resources, used for flanking and retreat.)
 +
 +
 +
1. Aggressivly push to medium range. Little damage is done at long range, so pushing to medium maximises your damage and also pushes your opponent, especially if you have many pushing at once. This is critical. Don't push when being attacked (I don't always follow this rule)
 +
 +
2. Retreat early when being attacked by units at medium range. Don't wait until your shield is <25%, otherwise those enemy units attacking you at medium range will continue to attack you as you move into long range, which is something you want to avoid with such a low shield. If you're being attacked my a machine gun and shotgun at medium range then you'll probably want to retreat at all shield/health levels.
 +
 +
3. Pay a lot of attention to your opponent's sniper. Your sniper should prioritize attacking the enemies sniper. If your sniper hits the opponent's sniper then it's probably worth changing the attack target of all your nearby units to it even if they are attacking medium range units (and only if it is safe/worthwhile doing so)
 +
 +
4. When attacking, tend to prioritise enemies that are already being attacked by your allies. If no enemies are being attacked by an ally then only attack enemies that are attacking or retreating. If no allies are attacking or retreating, then push(move) towards your enemy.
 +
 +
5. The shotgun should not always start shooting at the first unit it sees at medium range. Its good to get as close as you can to medium range units, especially if they are retreating or being attacked by an ally. This will give your shotgun more medium range shots as the enemy unit tries to escape from medium range. One of my SG rules is that it will only stop moving towards medium range units when at-least 2 units are in medium range.
 +
 +
6. The best way to collect resources depends on your current strategy and how well you are doing against the playerbase. Your resource collecting strategy will change as you change so I can't recommend one specific technique. It's ok to not focus on resource collecting while you hone other more important bits of your AI.
 +
 +
7. Minimise the time you spend switching your attack target. I have rules for when to switch. For the sniper and machine gun, whose reload time is quite long, it's especially important.
 +
 +
8. New players can totally ignore tagging for now when . They will waste a lot of time with them if they start using them.
 +
 +
9. Group your units together. Players do this in various ways. Many will move the unit to the nearest ally during a game if they wander too far away. I don't do that.
 +
 +
 +
1. Retreat at shield level other than 25% (from closest enemy attacking self)
 +
2. Continuously attacking enemy bots(this was a new concept for me)
 +
3. Attacking enemies nearby allies are attacking(focus fire)
 +
4. Focusing 25% or less shield enemies down(if you don't do this you'll never kill a bot)
 +
5. Move towards closest resource when out of range / pick up (good for scoring off pushes)
 +
 +
1. I can definitely say that of Chris's points, 2,3,6, and 8 is definitely spot on while 7 is simply once again explaining what currently targeted is.
 +
2. Don't explain dancing. As a tool used to trick enemy bots, it is definitely outdated and beaten by currently targeted, and for the most part, if you are dancing, it usually is for the purpose of retreating to save your shield, because you almost never can never get away with dancing as a trick anymore
 +
3. Both grouping together and focusing your fire definitely comes with pros and cons that many should be wary about. Grouping especially isn't something that I really think is necessarily good considering both the limitations in the information the bots has access to and that any time spent grouping is time lost not pushing.
 +
4. While Chris is correct that one should push towards getting in medium range, it definitely far from risk free, and always attacking second (as Chris makes it seem) is imo not the best of advice. While pushing is just overall important, a bad push can easily turn out much more horribly than not pushing at all. Thus, imo, it isn't good advice for beginners.
 +
5. Besides attacking the currently targeted enemy maybe focus firing, I'm not exactly certain how useful it would be to have strategies of which things to prioritize for attacking for a beginner, and I feel like what is best will change more and more depending on the situation at hand.
 +
 +
Beginners should avoid tagging for combat. Bad idea, too slow.
 +
 +
Only thing I would add is to think about maintainability. Don't use to complicated structures, map and bot specific stuff. It' easier to make one generic AI then to handle a truckload of specualized ones.
 +
 +
 +
-->

Revision as of 19:41, 4 December 2017

Information.png This page needs improvement, you are welcome to contribute.

Best practices for AI design

Some best coding practices from software development also apply to AIs in Gladiabots. The following rules can help improve the quality of AIs, enhancing both the initial development and subsequent maintenance of the AI.

Information.png
Divide and conquer. 

Break down a problem into two or more sub-problems and solve each of them separately. Complex sub-problems can again be divided. In Gladiabots this could be done by creating sub-AIs for each sub-problem. The complexity is reduced leading to a better maintainability.

Information.png
Readability first. 

AIs are written once, but read many times. Overlapping nodes, links crossing each other and great distances between linked nodes are difficult to read and should be avoided. AIs should have meaningful names revealing their purpose. One should consider to align nodes to the grid.

Information.png
Don't repeat yourself. 

Avoid using the exact same set of nodes in several places. Sometimes duplicate nodes can be prevented by using bot specific filters or additional conditions. If its not possible to prevent duplicate nodes in the first place one can try to move them to sub AIs.

Information.png
Keep it simple. 

The size of an AI has a significant effect on the error rate. A simple solution should be preferred over a complex one leading to the same or very similar results. One should ask the question: "Has this AI been implemented with the least amount of nodes necessary?". The more complex the AI is the more likely it is to be buggy.

Information.png
Test, test, test. 

"If debugging is the process of removing bugs, then programming must be the process of putting them in." (Edsger Wybe Dijkstra) As no developer is perfect, new nodes should be tested and debugged right after they were added.

Useful resources

  • In general, it is recommended to check the forum sections Questions and Strategies. Also "old" topics can give nice information. Another place where tactics are shared are the chat groups on Discord and Telegram (see forum links).
  • Shared ideas how players approach the game (several strong players, at least strong for the first half of 2017, contributed to the topic)