AIN: Difference between revisions
Jump to navigation
Jump to search

(Added nodetype table) |
|||
(10 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{stub}} | {{LanguageBar}} | ||
{{distinguish| | |||
An AIN file is a nodegraph for Source engine games. It stores information relating to | {{stub}}{{distinguish|.ani}} | ||
An '''AIN''' file is a nodegraph for Source engine games. It stores information relating to {{ent|info_node}}s and their proximity and visibility for use by the AI for movement around a map. AIN files are automatically generated by the game. If there is no existing AIN file specific to that map, or if it was generated for an older version of that map, the AIN file ( <MAP_NAME>.ain ) is generated by the game. The message "Node graph out of date. Rebuilding..." is printed to the screen when a build or rebuild is occurring. | |||
The graph files are stored in the ..\<game>\maps\graphs directory. | The graph files are stored in the ..\<game>\maps\graphs directory. | ||
Line 56: | Line 57: | ||
int lookup[numNodes];</source> | int lookup[numNodes];</source> | ||
[[Category:Level Design]] | [[Category:Level Design]] | ||
[[Category:AI]] | [[Category:AI]] | ||
[[Category:File formats]] | [[Category:File formats]] |
Latest revision as of 03:55, 12 July 2024


Not to be confused with .ani.
An AIN file is a nodegraph for Source engine games. It stores information relating to info_nodes and their proximity and visibility for use by the AI for movement around a map. AIN files are automatically generated by the game. If there is no existing AIN file specific to that map, or if it was generated for an older version of that map, the AIN file ( <MAP_NAME>.ain ) is generated by the game. The message "Node graph out of date. Rebuilding..." is printed to the screen when a build or rebuild is occurring.
The graph files are stored in the ..\<game>\maps\graphs directory.
File Format
Structs
struct ain_header // Probably incorrect header name
{
int ainet_ver; // AI Net version
int map_ver; // Map version
};
struct ain_node // Probably incorrect header name
{
Vector3 pos; // 3 floats (x, y, z)
float yaw;
float flOffsets[NUM_HULLS];
byte nodeType;
ushort nodeInfo;
short zone;
};
struct ain_link // Probably incorrect header name
{
short srcId;
short destId;
byte moves[NUM_HULLS];
};
NUM_HULLS is set to 10 for most maps tested.
These structs were based on AI Net version 37, might differ between games and versions.
Node types
Type | Name |
---|---|
2 | NODE_TYPE_GROUND |
3 | NODE_TYPE_AIR |
4 | NODE_TYPE_CLIMB |
5 | NODE_TYPE_WATER |
File layout
ain_header header;
int numNodes;
ain_node nodes[numNodes];
int numLinks;
ain_link links[numLinks];
int lookup[numNodes];