载入中...
搜索中...
未找到
ClimbingPrediction.cpp
浏览该文件的文档.
28 appendByte(hash, static_cast<std::uint8_t>((bits >> (index * 8)) & static_cast<Unsigned>(0xff)));
73bool readUint64String(const eve::Value::Object& object, std::string_view name, std::uint64_t& output,
179 eve::DiagnosticCode::ParseError, "authoritative snapshot has an invalid climbing runtime envelope",
183 eve::DiagnosticCode::UnknownVersion, "authoritative snapshot version is newer than this runtime",
191 return validKey(decision.authoritativeCandidate) && decision.reason == ClimbingPredictionReason::None;
197eve::Result<eve::Value::Object> readEnvelope(const eve::Value& value, std::string_view schemaId) {
201 eve::DiagnosticCode::ParseError, "prediction payload must be an object", {}, {}, "climbing.prediction"));
206 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "prediction schemaId is missing or mismatched",
210 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "prediction schemaVersion must be an integer",
214 eve::Diagnostic::error(eve::DiagnosticCode::UnknownVersion, "prediction schema version is unsupported",
255eve::Result<eve::Value> encodeClimbingPredictionRequest(const ClimbingPredictionRequest& request) {
258 eve::DiagnosticCode::InvalidArgument, "prediction request requires a non-zero sequence and candidate key",
269eve::Result<ClimbingPredictionRequest> decodeClimbingPredictionRequest(const eve::Value& value) {
280 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "prediction request has missing or invalid fields",
289eve::Result<eve::Value> encodeClimbingPredictionDecision(const ClimbingPredictionDecision& decision) {
309eve::Result<ClimbingPredictionDecision> decodeClimbingPredictionDecision(const eve::Value& value) {
324 !readDisposition(disposition, decision.disposition) || !readString(root.value(), "reason", reason) ||
325 !readReason(reason, decision.reason) || !key || !decodeKey(*key, decision.authoritativeCandidate) ||
328 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "prediction decision has missing or invalid fields",
335 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "prediction decision fields are inconsistent",
Deterministic climbing/parkour planning and capsule-constrained execution.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
const T * getIf() const noexcept
Return a typed pointer, or nullptr when the kind differs.
Definition Value.h:180
static constexpr std::int64_t SnapshotSchemaVersion
Current runtime snapshot version; v3 is N-1 and historical v2/v1/v0 remain migratable.
Definition Climbing.h:658
eve::Result< eve::Value > snapshot() const
Captures deterministic runtime state; debug candidates and final bone poses are excluded.
Definition ClimbingSnapshot.cpp:393
eve::Result< ClimbingCandidateSet > probe(physics::World3D &world, const ClimbingPose &pose) const
Probes, validates, and deterministically sorts all matching candidates.
Definition Climbing.cpp:166
eve::Result< ClimbingPredictionDecision > tryBeginPredicted(physics::World3D &world, const ClimbingPose &pose, const ClimbingPredictionRequest &request, eve::SimulationTick serverTick, std::uint64_t maxClientTickLead)
Re-probes authoritative state and commits only the exact server-matched predicted candidate.
Definition ClimbingPrediction.cpp:347
static constexpr std::string_view SnapshotSchemaId
Stable schema id for owning runtime snapshots.
Definition Climbing.h:656
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:63
Definition Climbing.cpp:19
EVENGINE_API_DOMAINS eve::Result< eve::Value > encodeClimbingPredictionRequest(const ClimbingPredictionRequest &request)
Encodes a validated prediction request to its canonical owning Value representation.
Definition ClimbingPrediction.cpp:255
ClimbingPhase
Execution lifecycle visible to gameplay and animation adapters.
Definition Climbing.h:470
@ Completed
@ Cancelled
EVENGINE_API_DOMAINS eve::Result< eve::Value > encodeClimbingPredictionDecision(const ClimbingPredictionDecision &decision)
Encodes a validated authoritative decision to its canonical owning Value representation.
Definition ClimbingPrediction.cpp:289
ClimbingPredictionReason
Stable reason for a non-accepted prediction decision.
Definition Climbing.h:421
@ RuntimeBusy
@ CandidateMismatch
@ TickTooFarAhead
@ InvalidRequest
@ NoCandidate
ClimbingPredictionDisposition
Named server-authoritative outcome of one prediction request.
Definition Climbing.h:418
EVENGINE_API_DOMAINS eve::Result< ClimbingPredictionDecision > decodeClimbingPredictionDecision(const eve::Value &value)
Decodes a complete authoritative decision transactionally.
Definition ClimbingPrediction.cpp:309
eve::detail::StrongUint64< detail::ClimbingPredictionSequenceTag > ClimbingPredictionSequence
Non-zero client command sequence used to pair one prediction decision.
Definition Climbing.h:380
ClimbingActionKind
Data-driven action family; stable action identity remains the definition id.
Definition Climbing.h:46
EVENGINE_API_DOMAINS eve::Result< ClimbingPredictionRequest > decodeClimbingPredictionRequest(const eve::Value &value)
Decodes a complete request and rejects unknown schema versions transactionally.
Definition ClimbingPrediction.cpp:269
EVENGINE_API_DOMAINS ClimbingCandidateKey makeClimbingCandidateKey(const ClimbingCandidate &candidate, std::uint32_t sortedRank) noexcept
Creates the opaque key for one candidate at its deterministic sorted rank.
Definition ClimbingPrediction.cpp:226
bool readString(const eve::Value::Object &object, const char *name, std::string &output)
Definition ArtifactProvider.cpp:20
const EditorValue * field(const EditorValue &value, const char *name)
Definition RoadNetworkEditTarget.cpp:15
bool readUint64String(const eve::Value::Object &object, const char *name, std::uint64_t &output)
Definition ArtifactProvider.cpp:46
Result< std::vector< uint8_t > > quantize(std::span< const float > input, float scale, int zero, bool sign)
Affine quantization to int8/uint8 bytes, saturating and rounding ties to even.
Definition AffineQuant.cpp:24
@ InvalidArgument
@ UnknownVersion
@ ParseError
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31
Opaque deterministic identity of one sorted candidate; contains no client-authored position.
Definition Climbing.h:389
Owning, replayable climbing candidate; contains no borrowed query pointers.
Definition Climbing.h:290
Input pose used for one deterministic candidate probe.
Definition Climbing.h:275
Server-to-client decision carrying the authoritative runtime snapshot for reconciliation.
Definition Climbing.h:431
ClimbingPredictionSequence sequence
Definition Climbing.h:437
eve::Value authoritativeSnapshot
Canonical server runtime state after the decision, used for rollback/replay reconciliation.
Definition Climbing.h:445
eve::SimulationTick serverTick
Definition Climbing.h:439
static constexpr std::int64_t SchemaVersion
Current decision schema version.
Definition Climbing.h:435
ClimbingPredictionReason reason
Definition Climbing.h:441
eve::SimulationTick clientTick
Definition Climbing.h:438
eve::Value::Object extensionMetadata
Unknown schema fields retained across decode and encode.
Definition Climbing.h:447
ClimbingPredictionDisposition disposition
Definition Climbing.h:440
ClimbingCandidateKey authoritativeCandidate
Server-selected key; fingerprint zero means no authoritative candidate was available.
Definition Climbing.h:443
static constexpr std::string_view SchemaId
Canonical cross-process schema id.
Definition Climbing.h:433
Client-to-server request containing selection identity only, never a world-space target.
Definition Climbing.h:404
static constexpr std::string_view SchemaId
Canonical cross-process schema id.
Definition Climbing.h:406