Tags: myuu-151/Affinity
Tags
Script tick: dispatch Released before Held — held state wins ties Rolling an analog stick from Up to Right genuinely releases Up while Right is still held. With released dispatched last, an On Key Released -> PlaySkelAnim(idle) chain stomped the still-held direction's walk clip for one frame, the runtime saw a clip change, and the walk animation reset on every direction switch. New order (PSV main.c + NDS script_glue, scene + blueprint dispatchers): update -> released -> held -> pressed. A released chain's write is immediately overridden by ongoing held state in the same tick, so animations persist across direction changes and only land on idle when everything is let go. Pressed stays last so one-shot chains (attack on press) still override held walks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PSV: analog stick ramp — slight push = slow move, full push = max Stick keys were digital: any deflection past the Sensitivity threshold moved at full speed. Now input_update() computes afn_stick_mag[8] (0 below threshold, then 32..256 linearly to full deflection) and key dispatchers set afn_key_mag at chain entry (buttons = 256). MovePlayer, OrbitCamera and TurnPlayer scale by it, so movement, camera orbit and tank turning all ramp with deflection. New Strength slider on stick Key nodes (paramInt[2]) scales the ramp's output per direction. NDS emits unchanged behavior (afn_key_mag is a constant 256 in script_glue.c). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PSV: CPU camera light (baked vertex colors) — fix per-vertex jitter o… …n hardware vitaGL's fixed-function GL_LIGHTING shades correctly through Vita3K but on real SGX hardware the per-vertex lit values jitter/step while the camera orbits (USSE precision in the generated lighting path). Rigs are already CPU-skinned every frame, so evaluate the headlamp on the CPU in fp32 and bake it into vertex colors; the GPU draws unlit. Same NDS-matched math (8/31 ambient + 28/31 * N.L, clamped); the eye-space light dir is transformed once per rig (view^T then basis^T) so the per-vertex cost is one dot product. Two-sided rigs light |N.L| (PSP's negated-light back pass folded into the abs). Bit-identical on hardware and emulator by construction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PSV: orbit up/down (pitch) gets the camera delay too Mirror the yaw design for pitch: the VIEW pitch snaps with orbit_pitch, but the eye's position pitch chases it with the shared ease rate (walk/sprint, maxed with AFN_ORBIT_EASE_IN/OUT while orbiting) — both the eye height and the XZ orbit radius follow the eased pitch, so pitching slides the player off-center vertically and re-centers as the camera catches up. Pitch movement counts as "orbiting" for the ease pick, and AFN_ORBIT_MAX_DELTA caps per-frame pitch like yaw. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PSV: true AABB NPC collision (full box extents + center offset)
Replace the cylinder approximation with the full glTF bounding box. Exporter
emits afn_npc_col[i] = { hx,hy,hz, cx,cy,cz } (independent half-extents +
center offset, world px) instead of { radius,bottom,top }. Runtime uses a real
circle-vs-AABB resolve: the player (cylinder COL_RADIUS) is ejected out the
nearest box face when its center is inside, or pushed to the circle boundary off
the closest box point at edges/corners. The OnCollision trigger and the gravity
floor-snap use the same box (Y rests cy-hy on the floor). Independent X/Z and the
box's X/Z center offset are now honored instead of collapsed to one radius.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Editor: fix camera-slot persistence + close crash (vector memcpy)
Camera presets vanished on reload and the editor crashed on close, once
FloorSprite gained a std::vector (cameraSlots):
- The scene system snapshotted scenes with memcpy(sc.sprites, sSprites,
sizeof(sSprites)). A raw byte copy of a struct containing std::vector
aliases the vector's heap pointer -> the snapshot and live array share
one buffer (slot corruption + double-free crash on close). Replaced all
four Save/Load{Map,M7}SceneState memcpys with element-wise assignment.
- camSlot was only serialized in the main [Sprites] block, not the scene
snapshots ([MapScenes]/[M7Scenes]) that get activated on load — so the
loaded slots were immediately overwritten by the slot-less scene. Added
msCamSlot/m7CamSlot save+load.
- Clear a sprite's cameraSlots on load before the camSlot lines refill it,
so an in-editor reload doesn't accumulate stale slots.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mode 4: tank controls (Turn Player node) + decoupled camera Add a tank-control scheme where the player's facing and the camera are two independent angles turned by different inputs at once. - Turn Player node (Direction + Speed): rotates a new afn_player_heading. Put it on D-pad Left/Right to turn the tank. Using it auto-enables tank mode (sets afn_tank_camera), so no separate enable node is required. - Tank Camera node: optional explicit toggle (wire 0 to leave tank mode and return to camera-relative controls). - Runtime: in tank mode, movement uses brad_sin/cos(afn_player_heading) and the rig faces the heading, while the camera keeps orbiting freely on orbit_angle (L/R) — so D-pad turns the player and the shoulders orbit the camera simultaneously. afn_player_heading seeds to AFN_CAM_ANGLE at spawn. Speed pin tunes the turn rate (brads/frame). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PreviousNext