asdfg
This commit is contained in:
parent
f6d7412744
commit
091afc2b5c
77 changed files with 4405 additions and 8223 deletions
|
|
@ -80,9 +80,6 @@
|
|||
const isNear = isVisible || Boolean(Geometry.pointInRect(tarinai.x || 0, tarinai.y || 0, farRect));
|
||||
const motionNeed = hasMotionNeed(tarinai);
|
||||
const perfProfile = global.TarinaiPerf?.performanceProfile?.();
|
||||
if (perfProfile?.simulationThrottled === false) {
|
||||
return { interval: 0, lane: "quality-high", smoothMotion: false, visible: isVisible, near: isNear, urgent: false };
|
||||
}
|
||||
|
||||
const nestEntryActive = Boolean(tarinai.insideNestBoxId && (typeof tarinai.nestBoxEntryActive === "function" ? tarinai.nestBoxEntryActive() : ((worldRef.time || 0) < (tarinai._nestBoxEntrySmoothUntil || -Infinity) || ((tarinai.nestFade || 0) > 0.01 && (tarinai.nestFade || 0) < 0.985))));
|
||||
if (nestEntryActive) return { interval: 0, lane: "nest-entry", smoothMotion: false, visible: true, urgent: true };
|
||||
|
|
@ -92,9 +89,38 @@
|
|||
(tarinai.pokeFlashTimer || 0) > 0.03 ||
|
||||
(tarinai.entryTimer || 0) > 0.01 ||
|
||||
(tarinai.fallTimer || 0) > 0.01 ||
|
||||
/fight|knockback|danger|hurt|ant_attack|cursor_enemy|explosion/i.test(id);
|
||||
/knockback|danger|hurt|ant_attack|cursor_enemy|explosion/i.test(id);
|
||||
if (hardRealtimeUrgent) return { interval: 0, lane: "urgent", smoothMotion: false, visible: isVisible, urgent: true };
|
||||
|
||||
// Fighting used to run the complete AI/environment/health pipeline for every
|
||||
// participant on every rendered frame. Dense conflict presets then formed a
|
||||
// positive feedback loop of fights, effects and collision work. Keep motion
|
||||
// smooth, but quantize the expensive full pipeline to a bounded cadence.
|
||||
const fightUrgent = state === "fight" || (tarinai.fightTimer || 0) > 0.04 || /fight/i.test(id);
|
||||
if (fightUrgent) {
|
||||
// Even the full-quality profile must not execute the entire dense-fight
|
||||
// pipeline once per rendered frame. It gets a tighter cadence than the
|
||||
// throttled profiles, while visible motion remains interpolated.
|
||||
const highQuality = perfProfile?.simulationThrottled === false;
|
||||
const baseInterval = highQuality
|
||||
? (isVisible ? 0.035 : (isNear ? 0.07 : 0.14))
|
||||
: (isVisible ? 0.06 : (isNear ? 0.12 : 0.24));
|
||||
const interval = baseInterval
|
||||
* Math.max(1, Number(perfProfile?.creatureCadenceScale || 1));
|
||||
return {
|
||||
interval,
|
||||
lane: highQuality ? "fight-quality-high" : "fight",
|
||||
smoothMotion: Boolean(isVisible && !worldRef.isTarinaiHiddenInNestBox?.(tarinai)),
|
||||
visible: isVisible,
|
||||
near: isNear,
|
||||
urgent: true,
|
||||
};
|
||||
}
|
||||
|
||||
if (perfProfile?.simulationThrottled === false) {
|
||||
return { interval: 0, lane: "quality-high", smoothMotion: false, visible: isVisible, near: isNear, urgent: false };
|
||||
}
|
||||
|
||||
// Panic movement must stay visually continuous, but the full creature
|
||||
// pipeline does not need to run every rendered frame. Treat panic as
|
||||
// a high-priority motion lane: AI/timers are quantized, motion-only still
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue