Statically link upstream Detour into wto_ws.dll with a navigation engine
(native/wto-nav) that loads one .wtonav pack per battle, reads the level
file's eVER fingerprint and answers path queries through a cost filter
that multiplies chokepoint polygons. Start and goal points that do not
sit on the ground are retried over the mesh's height range.
The ground AI script talks to it through call_mission_action("wtoNav")
with load_map, unload_map, find_path and get_stats. Requests are string
parameters; replies use the DataBlock setters local_mp_awards already
resolves, with coordinates as centimetre ints, so no new native site is
needed. The local server writes the battle level into customBots
wtoLevel, and the build writes the pack folder as nav.dir in wto_ws.cfg
(build-game-copy.ts --map-nav).
The first load_map of a battle decides it once: loaded, fallback to the
script's own navigation, or refused when navEngine.allowFallback is off,
in which case bots do not plan or drive. A fingerprint mismatch is
logged and the pack is still used. The script proves the round trip
with one path per team at battle start and logs query statistics.
Add the navEngine, navCostsTracked and navCostsWheeled tuning sections
through the server reader, generated daScript constants and the
launcher's bot tuning page in both languages.
Verified with root and launcher type checks, MSVC builds without
warnings in project code, check-patches 14/14 on 2.61.0.58 and
2.61.0.60, native module resolution 14/14 on 2.61.0.37, .58, .60 and
.64, a scratch game copy build packing 29 ground AI modules, and an
offline run of the engine: all three maps load with matching
fingerprints and every spawn-to-capture path on every tier succeeds.
81 lines
3.7 KiB
JSON
81 lines
3.7 KiB
JSON
// Temporary movement ownership for custom ground AI on a LocalMP host.
|
|
// The local server cannot restore the MoveSystem flag if a game script stops running.
|
|
// Without this module, stock tank movement keeps ownership of the vehicle.
|
|
// The same mission action carries the script's "wtoNav" navigation queries, answered through the
|
|
// DataBlock setters of local_mp_awards.
|
|
{
|
|
"module": "local_mp_ground_ai",
|
|
"features": ["K-AI opponents and teammates"],
|
|
"requires": ["local_mp_core", "local_mp_players", "local_mp_awards"],
|
|
"sites": {
|
|
// daScript call_mission_action binding, capturing the registered native function.
|
|
// 2.61.0.37: 0xa6be4d -> 0xa63750. 2.61.0.58: 0xa6eb0d -> 0xa66410.
|
|
"ground_ai_mission_binding": {
|
|
"variants": [{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "string_ref",
|
|
"string": "call_mission_action",
|
|
"lea_at": 0,
|
|
"pattern": "48 8d 15 ?? ?? ?? ?? 4c 8d 05 ?? ?? ?? ?? e8 ?? ?? ?? ?? 80 8e 30 01 00 00 04 48 8d 05 ?? ?? ?? ?? 48 89 06 48 8d 05 ?? ?? ?? ?? 48 89 86 b0 01 00 00",
|
|
"captures": {
|
|
"action": { "offset": 39, "type": "rel32" }
|
|
}
|
|
}
|
|
}]
|
|
},
|
|
// Leaf shared by the two daScript as_gm overloads. The mask is the engine's ground-model check.
|
|
// 2.61.0.37: 0xa1f1f0. 2.61.0.58: 0xa21ea0.
|
|
"ground_ai_as_ground_model": {
|
|
"variants": [{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "signature",
|
|
"pattern": "48 85 c9 74 15 8b 91 ?? ?? ?? ?? f7 d2 31 c0 f7 c2 00 80 01 00 48 0f 44 c1 c3 31 c0 c3"
|
|
}
|
|
}]
|
|
},
|
|
// IGroundModel's avoidObstacles property handler reads its MoveSystem pointer.
|
|
// 2.61.0.37: 0x424334. 2.61.0.58: 0x4248d4.
|
|
"ground_ai_move_properties": {
|
|
"variants": [{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "string_ref",
|
|
"string": "avoidObstacles",
|
|
"lea_at": 0,
|
|
"pattern": "48 8d 15 ?? ?? ?? ?? 4c 8d 44 24 24 48 89 d9 e8 ?? ?? ?? ?? 84 c0 74 13 48 8b 87 ?? ?? ?? ?? 48 85 c0 74 07 c6 80 ?? ?? ?? ?? 01",
|
|
"captures": {
|
|
"move_system": { "offset": 27, "type": "u32" }
|
|
}
|
|
}
|
|
}]
|
|
},
|
|
// The MoveSystem daScript annotation registers the bool field named "inactive".
|
|
// 2.61.0.37: 0xa1c374. 2.61.0.58: 0xa1f024.
|
|
"ground_ai_move_annotation": {
|
|
"variants": [{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "signature",
|
|
"pattern": "48 b8 69 6e 61 63 74 69 76 65 48 89 44 24 30 c6 44 24 38 00 c6 44 24 67 0f 48 89 44 24 50 c6 44 24 58 00 48 8b 8b a8 01 00 00 e8 ?? ?? ?? ?? 48 89 84 24 a0 00 00 00 4c 89 74 24 20 48 8d 54 24 50 4c 8d 44 24 30 48 89 d9 41 b9 ?? ?? ?? ?? e8 ?? ?? ?? ??"
|
|
,"captures": {
|
|
"inactive": { "offset": 75, "type": "u32" }
|
|
}
|
|
}
|
|
}]
|
|
},
|
|
// driveToPos::update (vtable[1] of the tankBot driveToPos behavior node).
|
|
// 2.61.0.37: 0x861370. 2.61.0.58: 0x863a90.
|
|
"ground_ai_drive_to_pos_update": {
|
|
"variants": [{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "signature",
|
|
"pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec 98 02 00 00 44 0f 29 bc 24 80 02 00 00 44 0f 29 b4 24 70 02 00 00 44 0f 29 ac 24 60 02 00 00 44 0f 29 a4 24 50 02 00 00 44 0f 29 9c 24 40 02 00 00 44 0f 29 94 24 30 02 00 00 44 0f 29 8c 24 20 02 00 00 44 0f 29 84 24 10 02 00 00 0f 29 bc 24 00 02 00 00 0f 29 b4 24 f0 01 00 00 44 0f 28 da 49 89 cf 48 8b 3d ?? ?? ?? ?? 44 8b 72 08 0f b6 87 f3 00 00 00 48 8b 9f 60 06 00 00 48 85 db 40 0f 94 c5 40 08 c5 40 f6 c5 01 75 09 48 89 d9 ff 15 ?? ?? ?? ?? 44"
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
}
|