Add mission customization, HQ support and aggression-driven AI
Integrate faction and random settings menus, generated objectives, scouts, convoys, air support, mortar stations and body-intel recovery. Add identified-body aggression, finite hunter UAZ deployment, dedicated objective defence and maximum AI skill with separate reduced aim accuracy. Include policy tests, native probes, evidence and documentation.
This commit is contained in:
@@ -4,7 +4,7 @@ This verifies bounded search order/termination, not terrain or body clearance.
|
||||
from policy_harness import ROOT,body,run
|
||||
source=ROOT/'addons/core/Scripts/Game/ERR/00_Core/ERR_SpawnPlacement.c'
|
||||
search=(body(source,'bool Prison(').replace('map<int, vector> reservations','map<int, vector>* reservations')
|
||||
.replace('out vector position','vector& position').replace('ERR_Actors.', 'ERR_Actors::').replace('Math.', 'Math::'))
|
||||
.replace('out vector position','vector& position').replace('ERR_Actors.', 'ERR_Actors::').replace('Math.', 'Math::').replace('ERR_CampTerrain.', 'ERR_CampTerrain::'))
|
||||
run('''#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
@@ -16,6 +16,7 @@ vector Vector(float x,float y,float z){return {x,y,z};}
|
||||
template<class K,class V> struct map {};
|
||||
namespace ERR_Actors {vector Ground(vector value){return value;}}
|
||||
namespace Math {int AbsInt(int value){return std::abs(value);}}
|
||||
namespace ERR_CampTerrain {vector Rotate(vector v,float a){float r=a*3.14159265359f/180;return {v.x*std::cos(r)+v.z*std::sin(r),v.y,-v.x*std::sin(r)+v.z*std::cos(r)};}}
|
||||
struct Search {
|
||||
std::vector<vector> visited;
|
||||
int accept=-1;
|
||||
@@ -23,6 +24,7 @@ struct Search {
|
||||
''' + search + '''
|
||||
};
|
||||
int main(){
|
||||
Search rotated;rotated.accept=0;vector turned;assert(rotated.Prison(Vector(0,0,0),nullptr,turned,90));assert(std::abs(turned.x+1.5)<.001&&std::abs(turned.z-1.5)<.001);
|
||||
const vector center={6090,100,7160};
|
||||
vector result={-1,-1,-1};
|
||||
Search blocked;
|
||||
@@ -57,3 +59,37 @@ int main(){
|
||||
}
|
||||
''')
|
||||
print('PASS: prison search packs 16 unique 3m-spaced inside-wall centers, prioritizes inner/edge positions and never bypasses clearance')
|
||||
|
||||
occupancy = (body(source, 'protected bool Occupied(').replace('protected ', '')
|
||||
.replace('IEntity entity', 'IEntity* entity').replace('entity.', 'entity->')
|
||||
.replace('ChimeraCharacter.Cast', 'ChimeraCharacter::Cast')
|
||||
.replace('vector.', 'vector::').replace('Math.', 'Math::'))
|
||||
run(r'''
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <initializer_list>
|
||||
struct vector {
|
||||
float x=0,y=0,z=0;
|
||||
float operator[](int i) const {return i==0?x:(i==1?y:z);}
|
||||
static float DistanceXZ(vector a,vector b){return std::hypot(a.x-b.x,a.z-b.z);}
|
||||
};
|
||||
struct IEntity {vector position;bool character=true;vector GetOrigin(){return position;}};
|
||||
namespace ChimeraCharacter {bool Cast(IEntity* e){return e&&e->character;}}
|
||||
namespace Math {float AbsFloat(float f){return std::abs(f);}}
|
||||
struct Placement {
|
||||
IEntity* m_Exclude=nullptr; vector m_Candidate; bool m_Blocked=false;
|
||||
''' + occupancy + r'''
|
||||
};
|
||||
int main(){
|
||||
IEntity body;
|
||||
for(float distance : {0.f,1.199f,1.2f,2.12f,3.f}) {
|
||||
Placement p;body.position={distance,0,0};
|
||||
assert(p.Occupied(&body)==(distance>=1.2f));
|
||||
}
|
||||
Placement vertical;body.position={0,2,0};assert(vertical.Occupied(&body));
|
||||
Placement excluded;excluded.m_Exclude=&body;body.position={0,0,0};assert(excluded.Occupied(&body));
|
||||
Placement scenery;body.character=false;assert(scenery.Occupied(&body)); // geometry uses the separate native trace
|
||||
assert(scenery.Occupied(nullptr));
|
||||
}
|
||||
''')
|
||||
print('PASS: physical body occupancy rejects overlap, permits diagonal neighboring slots, and excludes own body and unrelated broad-phase bounds')
|
||||
|
||||
Reference in New Issue
Block a user