Difference between revisions of "Strategies"
(Tagging does not use ticks.) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Ideas worth implementing == | == Ideas worth implementing == | ||
Line 94: | Line 34: | ||
=== General === | === General === | ||
+ | |||
+ | [[File:Decorator for Meeting Point.jpg|thumb|Decorator for Meeting Point that starts to score if there are only 4 bots left.]] | ||
{{InformationCollapsed|1=Think about maintainability.|2=Don't use to complicated structures, map and bot specific stuff. It's easier to make one generic AI then to handle a truckload of specialized ones.}} | {{InformationCollapsed|1=Think about maintainability.|2=Don't use to complicated structures, map and bot specific stuff. It's easier to make one generic AI then to handle a truckload of specialized ones.}} | ||
− | {{InformationCollapsed|1=Ignore tagging.|2=New players can totally ignore tagging. (especially for combat) | + | {{InformationCollapsed|1=Decorate a generic AI.|2=The [https://en.wikipedia.org/wiki/Decorator_pattern decorator pattern] can be used to add flexibility to a generic AI. A decorator is a simple program to tell a bot what to do at the start of the map or in certain situations. Tags or conditions can activate or deactivate certain parts of the generic main AI. The different parts of the main AI are included as a sub AI.}} |
+ | |||
+ | {{InformationCollapsed|1=Ignore tagging.|2=New players can totally ignore tagging. (especially for combat) }} | ||
{{InformationCollapsed|1=Start experimenting.|2=Don't follow rules. Sometimes you have to break a rule to dominate. Some rules also have cons one should be wary about.}} | {{InformationCollapsed|1=Start experimenting.|2=Don't follow rules. Sometimes you have to break a rule to dominate. Some rules also have cons one should be wary about.}} | ||
− | + | == 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=|2= | + | {{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.}} | |
+ | == Simple bots == | ||
− | + | One can learn of bots with few nodes that have a pretty good performance in the game. They are a great base to start optimizing for beginners but also for advanced players to test their AI against. | |
− | + | === Ultimate AI for beginners (16 nodes) === | |
− | -- | + | PEW presented this [https://forum.gladiabots.com/viewtopic.php?f=3&t=647 Ultimate AI for beginners] in the forum. |
+ | |||
+ | [[File:Ultimate AI for beginners.png|thumb|none|800px|Ultimate AI for beginners - [https://wiki.gladiabots.com/images/3/3c/Ultimate_AI_for_beginners.png Higher resolution (2236 × 1228 pixel)]]] | ||
+ | |||
+ | The AI is split into this main modules: | ||
+ | |||
+ | * Blue: The retreat module | ||
+ | * Yellow: The shooting module (with high priority) | ||
+ | * Green: The resource module | ||
+ | * Red: The pushing module | ||
+ | * Pink: The shooting module (with low priority) | ||
+ | |||
+ | === Grand Master League Bot (30 nodes) === | ||
+ | |||
+ | LuBeNo presented this [https://forum.gladiabots.com/viewtopic.php?f=3&t=605 Grand Master League Bot] in the forum. | ||
+ | |||
+ | [[File:Grand Master League Bot.png|thumb|none|800px|Grand Master League Bot - [https://wiki.gladiabots.com/images/7/7a/Grand_Master_League_Bot.png Higher resolution (2276 × 986 pixel)]]] | ||
+ | |||
+ | The AI is split into this modules: | ||
+ | |||
+ | * Defense | ||
+ | * Shotgun | ||
+ | * Offense | ||
+ | * Dancing | ||
+ | |||
+ | == Useful resources == | ||
+ | |||
+ | There are several places to discover new strategies, learn tactics of other players or ask questions: | ||
+ | |||
+ | * Check the [https://forum.gladiabots.com community forum]. Also "old" topics there can give nice information. | ||
+ | ** Especially the sections ''Strategies'' and ''Questions'' are interesting. | ||
+ | ** For example check [https://forum.gladiabots.com/viewtopic.php?f=3&t=823 this topic about shared ideas how players approach the game]. Several strong players of the year 2017 contributed to it. | ||
+ | * Check the chat groups on [http://telegram.gladiabots.com/ telegram] and [http://discord.gladiabots.com/ discord]. | ||
+ | * Check the wiki itself to learn about game mechanics and bot programming and their sub topics. There are several nifty details to discover. | ||
+ | * Check the [[changelog]] or [http://roadmap.gladiabots.com roadmap] to learn about recent or planned changes and adjust your AIs according to them. | ||
+ | |||
+ | Last but not least one should play the game. Especially lost games show flaws of the AI, that need to improved. Try to analyze the strategy your enemy used. |
Revision as of 16:46, 11 August 2018
Contents
Ideas worth implementing
Retreat
|
Attack
|
|
|
Push
|
|
|
Resources
|
|
Shotgun
|
General
|
|
|
|
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.
|
|
|
|
|
Simple bots
One can learn of bots with few nodes that have a pretty good performance in the game. They are a great base to start optimizing for beginners but also for advanced players to test their AI against.
Ultimate AI for beginners (16 nodes)
PEW presented this Ultimate AI for beginners in the forum.
The AI is split into this main modules:
- Blue: The retreat module
- Yellow: The shooting module (with high priority)
- Green: The resource module
- Red: The pushing module
- Pink: The shooting module (with low priority)
Grand Master League Bot (30 nodes)
LuBeNo presented this Grand Master League Bot in the forum.
The AI is split into this modules:
- Defense
- Shotgun
- Offense
- Dancing
Useful resources
There are several places to discover new strategies, learn tactics of other players or ask questions:
- Check the community forum. Also "old" topics there can give nice information.
- Especially the sections Strategies and Questions are interesting.
- For example check this topic about shared ideas how players approach the game. Several strong players of the year 2017 contributed to it.
- Check the chat groups on telegram and discord.
- Check the wiki itself to learn about game mechanics and bot programming and their sub topics. There are several nifty details to discover.
- Check the changelog or roadmap to learn about recent or planned changes and adjust your AIs according to them.
Last but not least one should play the game. Especially lost games show flaws of the AI, that need to improved. Try to analyze the strategy your enemy used.