Strategies

From Gladiabots Wiki
Revision as of 18:22, 4 December 2017 by LuBeNo (Talk | contribs)

Jump to: navigation, search
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 discussions

  • 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)