Improve AdventureBot recruitment, world presence and performance
Manage Arthoran as a persistent level-60 tank profile, add Worgen forms and mounts, enable PvP and recruit through native LFG with preparation actions and player invitations. Reduce repeated route and flight-planning work, bound failed-travel retries and add runtime timing diagnostics. Include 86 passing tests and measurements with 110 online bots.
This commit is contained in:
1 parent
cac4142ec1
commit
0173a434f4
39 files changed
+1958
-74
No files matched your search
@@ -53,11 +53,11 @@ bool Unsafe(Player* p){return p->combat||p->flying;}
|
||||
constexpr int PATHFIND_NORMAL=1;
|
||||
struct PathGenerator{
|
||||
struct Point{float x,y,z;};std::vector<Point> path;
|
||||
static inline bool reachable=true,broken=false;static inline int type=1;
|
||||
static inline bool reachable=true,broken=false;static inline int type=1;static inline float bend=20;
|
||||
PathGenerator(Player*){}void SetPathLengthLimit(float){}
|
||||
bool CalculatePath(Position const&a,Position const&b){
|
||||
path.clear();int n=int(a.GetExactDist(b)/4)+1;
|
||||
for(int i=0;i<=n;++i){float t=float(i)/n;path.push_back({a.m_positionX+(b.m_positionX-a.m_positionX)*t,a.m_positionY+(b.m_positionY-a.m_positionY)*t+20*std::sin(3.14159265f*t),a.m_positionZ+(b.m_positionZ-a.m_positionZ)*t});}
|
||||
for(int i=0;i<=n;++i){float t=float(i)/n;path.push_back({a.m_positionX+(b.m_positionX-a.m_positionX)*t,a.m_positionY+(b.m_positionY-a.m_positionY)*t+bend*std::sin(3.14159265f*t),a.m_positionZ+(b.m_positionZ-a.m_positionZ)*t});}
|
||||
if(broken && path.size()>5) path[5].z+=10;
|
||||
return reachable;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class AdventureBehaviorMgr{public:
|
||||
enum class Phase{Idle,OnSite,Switching};
|
||||
struct Record{
|
||||
AdventureInstancePolicy::Visit Instance;
|
||||
std::string Intent="leisure",Location="city",WantedIntent,WantedLocation,Detail;Position Anchor;uint32 AnchorMap=0,MicroTimer=240000;std::mt19937 Random{26};
|
||||
std::string Intent="leisure",Location="city",WantedIntent,WantedLocation,Detail;Position Anchor;uint32 AnchorMap=0,MicroTimer=240000,RetryTimer=0;std::mt19937 Random{26};
|
||||
time_t Deadline=0;bool Dirty=false;std::unordered_set<std::string> Tried;Phase State=Phase::OnSite;
|
||||
struct LeisureScene{bool Active=false,Flying=false,Moving=false,StopRequested=false,Returning=false,PlannedWalk=false,Progressive=false;std::string Kind;Position Origin;std::vector<Position> Route,WalkTrace;std::size_t Step=0,OutboundSteps=0;uint32 Elapsed=0,LegElapsed=0,PauseMs=0,CompanionWait=0,CompletedLegs=0;ClientlessCompanionScene Companion;}Leisure;
|
||||
};
|
||||
@@ -219,6 +219,12 @@ int main(){
|
||||
combatMgr.available=true;assert(mgr.LeisureAvailable(&p,r,{"training"}));
|
||||
assert(mgr.StartLeisure(&p,r,{"training"}) && combatMgr.starts==1);
|
||||
r.Intent="adventure";assert(!mgr.LeisureAvailable(&p,r,{"training"}));
|
||||
// Recruitment walks stay near the meeting point, also inside a tavern.
|
||||
mgr.ResetLeisure(&p,r);r.Intent="groupformation";r.MicroTimer=45000;terrain.outdoors=false;p.outdoors=false;PathGenerator::bend=2;
|
||||
assert(mgr.StartLeisure(&p,r,{"walk"}));
|
||||
for(auto const& point:r.Leisure.Route)assert(point.GetExactDist(r.Leisure.Origin)<=18);
|
||||
assert(!mgr.LeisureAvailable(&p,r,{"ride"}));mgr.ResetLeisure(&p,r);terrain.outdoors=true;PathGenerator::bend=20;
|
||||
r.RetryTimer=30000;r.Tried.insert("old");mgr.SetWanted(&p,r,"rest","new",1234);assert(r.RetryTimer==0&&r.Tried.empty()&&r.Deadline==1234);
|
||||
|
||||
}
|
||||
'''
|
||||
|
||||
Reference in new issue
Block a user