AI Sections: Difference between revisions

From Burnout Wiki
Content added Content deleted
(I have 8 and 0x20 the other way round than what was originally here? Might need to check)
Line 173: Line 173:
! Name !! Type !! Length !! Comments
! Name !! Type !! Length !! Comments
|-
|-
| SpanIndex || int16_t || 0x4 ||
| SpanIndex || int16_t || 0x2 ||
|}
|}



Revision as of 03:18, 29 January 2023

The AI sections resource encompasses the routes the AI takes along with details on each section such as speed and shortcut information.

Structures

BrnAI::AISectionsData

32-bit

Offset Length Type Name Description Comments
0x0 0x4 AISection* mpaSections
0x4 0x4 SectionResetPair* mpaSectionResetPairs
0x8 0x14 float32_t[5] mafSectionMinSpeeds
0x1C 0x14 float32_t[5] mafSectionMaxSpeeds
0x30 0x4 uint32_t muNumSections Maximum of 20,000
0x34 0x4 uint32_t muNumSectionResetPairs
0x38 0x4 uint32_t muVersion 12
0x3C 0x4 uint32_t muSizeInBytes

64-bit

Offset Length Type Name Description Comments
0x0 0x8 AISection* mpaSections
0x8 0x8 SectionResetPair* mpaSectionResetPairs
0x10 0x14 float32_t[5] mafSectionMinSpeeds
0x24 0x14 float32_t[5] mafSectionMaxSpeeds
0x38 0x4 uint32_t muNumSections
0x3C 0x4 uint32_t muNumSectionResetPairs
0x40 0x4 uint32_t muVersion 12
0x44 0x4 uint32_t muSizeInBytes

BrnAI::AISection

32-bit

Offset Length Type Name Description Comments
0x0 0x4 Portal* mpaPortals
0x4 0x4 BoundaryLine* mpaNoGoLines
0x8 0x4 Vector2* mpaCorners
0xC 0x4 AISectionId mId Section GameDB ID
0x10 0x2 SpanIndex miSpanIndex
0x12 0x2 uint16_t muNumNoGoLines Maximum of 200 walls
0x14 0x1 uint8_t mu8NumPortals Maximum of 32
0x15 0x1 uint8_t muSpeed SectionSpeed See SectionSpeed
0x16 0x1 uint8_t mu8eDistrict District Always null
0x17 0x1 uint8_t mx8Flags Flags See flags

64-bit

Offset Length Type Name Description Comments
0x0 0x8 Portal* mpaPortals
0x8 0x8 BoundaryLine* mpaNoGoLines
0x10 0x8 Vector2* mpaCorners
0x18 0x4 AISectionId mId Section GameDB ID
0x1C 0x2 SpanIndex miSpanIndex
0x1E 0x2 uint16_t muNumNoGoLines
0x20 0x1 uint8_t mu8NumPortals
0x21 0x1 uint8_t muSpeed SectionSpeed See SectionSpeed
0x22 0x1 uint8_t mu8eDistrict District Always null
0x23 0x1 uint8_t mx8Flags Flags See flags
0x24 0x4 padding

BrnAI::Portal

32-bit

Offset Length Type Name Description Comments
0x0 0x4 float32_t mPositionX
0x4 0x4 float32_t mPositionY
0x8 0x4 float32_t mPositionZ
0xC 0x4 BoundaryLine* mpaBoundaryLines
0x10 0x2 uint16_t mu16LinkSection Section index
0x12 0x1 uint8_t mu8NumBoundaryLines
0x13 0x1 uint8_t[1] mau8Pad padding

64-bit

Offset Length Type Name Description Comments
0x0 0x4 float32_t mPositionX
0x4 0x4 float32_t mPositionY
0x8 0x4 float32_t mPositionZ
0xC 0x4 padding
0x10 0x8 BoundaryLine* mpaBoundaryLines
0x18 0x2 uint16_t mu16LinkSection Section index
0x1A 0x1 uint8_t mu8NumBoundaryLines
0x1B 0x1 uint8_t[1] mau8Pad padding
0x1C 0x4 padding

BrnAI::BoundaryLine

Offset Length Type Name Description Comments
0x0 0x10 Vector4 mVerts

BrnAI::SectionResetPair

Offset Length Type Name Description Comments
0x0 0x4 uint32_t meResetSpeed See EResetSpeedType
0x4 0x2 uint16_t muStartSectionIndex
0x6 0x2 uint16_t muResetSectionIndex

Typedefs

BrnAI::AISection::AISectionId

Name Type Length Comments
AISectionId uint32_t 0x4

BrnStreetData::Road::SpanIndex

Name Type Length Comments
SpanIndex int16_t 0x2

Enumerations

BrnAI::SectionSpeed

Name Value Comments
E_SECTION_SPEED_VERY_SLOW 0
E_SECTION_SPEED_SLOW 1
E_SECTION_SPEED_NORMAL 2
E_SECTION_SPEED_FAST 3
E_SECTION_SPEED_VERY_FAST 4
E_SECTION_SPEED_COUNT 5

AISection flags

Name Value Comments
KX_SECTION_FLAG_SHORTCUT 0x1
KX_SECTION_FLAG_NO_RESET 0x2 No reset on track point
KX_SECTION_FLAG_IN_AIR 0x4 Typically right before jumps
KX_SECTION_FLAG_SPLIT 0x8 Road split, like at Moore/E. Crawford
KX_SECTION_FLAG_JUNCTION 0x10 Likely required for events
KX_SECTION_FLAG_TERMINATOR 0x20 Indicates walls etc. May not be end of the road
KX_SECTION_FLAG_AI_SHORTCUT 0x40
KX_SECTION_FLAG_AI_INTERSTATE_EXIT 0x80

BrnAI::EResetSpeedType

Name Value Comments
E_RESET_SPEED_TYPE_CUSTOM 0
E_RESET_SPEED_TYPE_NONE 1
E_RESET_SPEED_TYPE_SLOW 2
E_RESET_SPEED_TYPE_FAST 3
E_RESET_SPEED_TYPE_SLOW_NORTH_FACE 4
E_RESET_SPEED_TYPE_SLOW_SOUTH_FACE 5
E_RESET_SPEED_TYPE_SLOW_EAST_FACE 6
E_RESET_SPEED_TYPE_SLOW_WEST_FACE 7
E_RESET_SPEED_TYPE_SLOW_REVERSE 8
E_RESET_SPEED_TYPE_STOP_REVERSE 9
E_RESET_SPEED_TYPE_STOP_NORTH_FACE 10
E_RESET_SPEED_TYPE_STOP_SOUTH_FACE 11
E_RESET_SPEED_TYPE_STOP_EAST_FACE 12
E_RESET_SPEED_TYPE_STOP_WEST_FACE 13
E_RESET_SPEED_TYPE_STOP_NORTH_EAST_FACE 14
E_RESET_SPEED_TYPE_STOP_SOUTH_WEST_FACE 15
E_RESET_SPEED_TYPE_NONE_AND_IGNORE 16
E_RESET_SPEED_TYPE_WEST_AND_IGNORE 17
E_RESET_SPEED_TYPE_REVERSE_AND_IGNORE 18
E_RESET_SPEED_TYPE_REVERSE_AND_IGNORE_SLOW 19
E_RESET_SPEED_TYPE_COUNT 20