
I present to your attention my free translation, promised by Mr.
Takezo in his
commentary on the future of AI in GameDev.
Introduction
It's fun to watch the in-game visualization, especially if you created it yourself! However, in pursuit of this vivid impression, it is easy to forget that there is no need to visualize everything.
Below you will find a video tutorial on gameplay visualization and AI, recorded in the secret research lab AiGameDev.
Why do you need (good) visualization?
- Correctness - When implementing features, even if unit tests are used, it is important to have visualizations in order to be sure that the problem is understood correctly. Complex game worlds may have special cases that are not taken into account by unit tests.
- Detection of bugs - In addition, in fact, checks the performance of the code, visualization helps to get rid of many problems with the isolation of the bug. With a collection of visualizations, it is easier to identify a bug or understand "where the dog has buried."
- Optimization and customization - At the final stage of the project, if there are visualizations, it is easier to make changes to game levels, characters' behavior and gameplay.
Below are five visualizations that we used to develop the prototype of the game RUSHING BASES. Pay attention to how strongly these tools helped us both at the initial stage of the project, when building the infrastructure, and at the end, to optimize the game balance.
')
Example # 1 - Grid Map


What does she show?
This demo is made on the basis of a two-dimensional grid. The map shows which zones of the game world are available and which are not. By default, locked cells are marked magenta, and available cells are not marked at all.
How it works?
This is just one large texture with grid dimensions, which
is stretched to a debugging polygon. To eliminate the overlap, the vertical offset was used, while you can set the test depth, achieving a visible texture throughout the picture.
Why do you need it?
- It helps to understand what the grid resolution affects.
- Allows you to detect bottlenecks on the map and helps in the design of levels.
Example # 2 - Area Network


What does she show?
Fundamental representation of the game is based on groups of cells, which we call zones (
groups of cells, approx. Transl. ). Legs grow from the basics of finding a path and an influence map. The network of zones shows not only the zones themselves, but also their connection with each other.
How it works?
One copy of the circle is created, which is then drawn along the centers of each of the groups of cells (zones). The circle is scaled and gets a unique color depending on the size and zone ID. Connections between zones are drawn by splines, although I used to use arrows - they are less heavy for rendering, but more difficult to visualize. Zone labels are textures rendered by a graphics engine and placed on a world map with a vertical offset.
Why do you need it?
- It helps to get a compromise between the accuracy of the map and its simplicity.
- Visualization of the graph used by algorithms for finding paths and building influence maps.
- And still this thing can be shown with an important look to the customer and other people who have penetrated into the office "suddenly" [* censored *]
Example # 3 - Hierarchical Graph


What does he show?
This is a high-level search graph that is used by a hierarchical pathfinding algorithm. It is calculated on the basis of zones, but it has a special structure shown in the images above. Only the edges of the graph are shown, but the nodes can be seen.
How it works?
The graph is drawn as a set of edges. Each edge is drawn as a thin polygon, since Not all graphics drivers allow you to draw lines. Each node has a label drawn in the form of a sprite (
rectangles always turned towards the camera - there are sprites, approx. Transl. ).
Why do you need it?
- It helps to localize the problems of finding paths, if any.
- Allows you to see all possible paths that can be used by AI.
- Shows “lost” paths and other possible level design problems.
Example # 4 - Influence Map


What does he show?
This visualization displays an "influence map", i.e. cost (
importance ?, significance? - approx. transl. ) each of the zones for the character in the current game situation. Part of the zones, depending on the proximity of the opposition characters, is marked in red or yellow - these are risk zones. Other zones, profitable, marked with blue or turquoise due to previous successful passes. The pictures above show both of these factors separately and in combination in the same zone of “success” and “risk” labels.
How it works?
This is also implemented, as in the case with the grid card, through the imposition of textures with the only difference that the overlay textures must be updated along with the update of the influence map.
Why do you need it?
- Helps to comprehend the tactical decisions made by AI.
- Provides the designer with feedback for balancing and adjusting the decisions made by AI.
- Displays long-term level statistics, which also helps in balancing.
Example # 5 - Navigation Paths


What does he show?
This visualization displays the final navigational path traveled by all the actors in the game world during the game. It is presented as a series of arrows interconnected. Each arrow is a segment of the traversed path. It is also possible to show the history of previously traveled paths.
How it works?
Arrows are also drawn using narrow polygons. The difference is that polygons must be updated each time you change navigation. Some optimizations have been implemented to reduce the required computations with dynamic navigation updates.
Why do you need it?
- Displays the correctness of the path at a low level. Allows to detect path finding bugs.
- Displays the path finding solutions made by the AIs of both teams.
- It allows you to grasp the essence of high-level behavior, it is also useful in optimizing and improving level design.
- Provides the ability to visualize the evolution of such solutions in finding ways.
Conclusion
In our case, the navigation navigation visualization techniques described above were the best fit because The main task of the game is a tactical search for a path in a world with obstacles. These techniques brought many benefits in both low-level coding and high-level design of levels and behavior, as well as in various improvements and optimizations.
In general, it is very beneficial to have such visualizations for many other applications. The more time you devote to the implementation of the code, the more time it takes to create visual representations of the implemented entities. You will then say thanks to yourself for creating visualization tools!
Video, see the original article ... Approx. trans. original articles.UPD: fixed typos and translation errors. Thanks to all the bug reporters!