soldier.module
Versions
Every version of this package its world published, newest first by when it first appeared. A version published again later keeps its place.
Skeleton: Unbroken Front — scene, art-direction lighting, first-person player rig with AudioListener, shared core module, slice mounts (all six slices pending) --- design: build spec for Unbroken Front — architecture, engine constraints, six slices with references and done-when --- district: cheap low-frequency surface shader, 4-building block on the main intersection; art: view model (detailed rifle in named parts + articulated hands); player: OperatorController attaches and poses it --- district: fix nil shell material on side walls (root cause of ~100 untextured walls and the MaterialHandle error wave); incremental coroutine build so the map no longer exceeds the per-frame mutation cap; complete in edit and play --- scene: save build edits; district verified quiet - zero material and zero controller errors, 195 entities --- scene: persist build edits --- district: incremental resumable build (coroutine, not task.wait), fix nil shellAlt material, resolve materials per build not memoised, damp asphalt specular; art: view model mats resolved per build --- merge: fold in the house style guide, field-authoring spec and merge notes The HOUSE_STYLE.md guide, the field-authoring spec and the merge notes were left in the working tree by the review pass. Folding them into one commit so the tree carries a readable history rather than four overlapping ones. --- gunplay: real weapon state machine - firing walks the per-weapon recoil pattern and raycasts, reload transfers rounds only when the magazine seats (verified: 15 held to stage 0.83, then 30 with reserve 181->166 at 0.94), trigger uses a rising edge so a held press no longer starts then cancels a reload; input: operator inputMap with keyboard/gamepad/touch bindings; player: view model posed from weapon state (recoil displacement, magazine drop, support-hand reach, charging handle, trigger finger), hands at human scale, hip pose raised into frame --- scene: persist build edits (11 pending) --- scene: settle accept - build-baked entity attributes persisted --- player: real movement state - speed measured from the body's own displacement, sprint and crouch drive the character controller's speed, jump verified; fixes stepBody's lost dt parameter which had broken the component Verified in play: walk 3.150 m/s, sprint 6.300, crouch-walk 1.651 - exactly Core.Rules.Player. Every weapon-motion value (sway drag, bob, sprint lowering) was scaled by Core.State.speed, which had been pinned at zero, so the weapon was still because nothing was driving the body, not because the player was. --- player: movement state wiring - findController via component.get (the avatar proxy reports an EMPTY component.list() even when it carries a CharacterController, so enumerating found nothing and the player read as permanently still); speed measured from position delta; body intent published by Gunplay through Core.State; scene: settle accept of build-baked entity attributes --- fx: firing effects - pooled muzzle flash, tracer, casing, impact card, dust and sparks driven by the SHOT and IMPACT events; Presentation component owns the pools; muzzle and ejection-port world positions published from the weapon's own geometry Also confirms the movement-speed defect from the last report was a bad test, not a bug: speed reads 0 idle, 3.150 walking, 6.300 sprinting, 1.652 crouch-walking and 3.150 strafing, matching Core.Rules.Player exactly. --- enemy: training range with real hit detection Seven targets - steel at 12 m and 27 m, paper silhouettes at 47 m and 62 m - plus a backstop and a firing line, on the mount the enemy slice owns. A hit is resolved from the SAME raycast that drew the tracer: the entity the round struck arrives in the IMPACT event and is looked up against the range, so nothing is re-tested against a bounding box. Chest and head are separate entities, so a head hit is a different id, and damage comes from the real weapon table through Core.Rules.HitZones. Verified by firing down the centre lane: 16 shots, 1 hit, a headshot, 97.2 damage - exactly k17.damage 27 x HitZones.head 3.60 - one kill, and the struck paper target fell 86 degrees about its feet. --- art: hands rebuilt at real human anatomy A 19 cm hand, not a 9 cm one scaled up: 9.2 cm across the knuckles, fingers of varying length and width in three phalanges each (42/33/25), a thenar mass at the thumb base, a knuckle plate and a stitched palm patch on the glove, and a thumb opposed across the palm rather than sticking out sideways. The forearm is now BARE SKIN from the wrist to a sleeve rolled up above the elbow, matching the reference, and tapering 5.8 cm at the wrist to 8.2 cm at the elbow. Glove and skin materials rewritten: the glove was drawing with a timber-grain pattern, which is why it read as cardboard. Known not fixed: in frame the forearms still read as pale slabs and the hands are not legible. The arm is angled down and back but the visible result does not yet match the reference. --- art: weapon assembled as one continuous object The parts had real gaps - the handguard ended at z -0.39 and the barrel began at -0.4125, a 2.25cm hole straight through the weapon, which is why it read as a row of separate boxes. Every part is now placed on a continuous run of Z stations from butt to muzzle with a deliberate overlap, and the joins a real rifle has got added: barrel nut between receiver and handguard, handguard end cap, gas block, a proud magwell around the magazine, and a raked magazine that hangs from the well instead of sitting in a flat slab. The assembly is also now DRAWN at 0.78 scale while staying metric in geometry. Real view models are not to scale for exactly this reason: a 1.15m rifle 34cm from the camera puts the receiver and the muzzle at such different depths that the weapon falls apart under perspective. Verified by capture: the weapon now reads as one object - receiver, handguard, barrel and stock in sequence with the red-dot lens legible. Still wrong: the forearm reads as a pale plank across the lower frame, the parts remain boxy, and the hands themselves are not legible. --- audio: the game has sound, synthesised rather than bought Nineteen clips computed in Luau from arithmetic and baked to .soundClip assets by game.audio.synth - no credits spent, nothing that can fail on a request. gunshot a 3ms bright transient, a damped low body note for the chest thump, and a filtered noise tail. Seven weapons get seven sounds from one recipe because the body frequency, the tail length and the brightness are per-weapon: a pistol is a snap, the precision rifle is a boom. click one shaped impulse - trigger on an empty chamber, magazine catch action a scrape into a clack - bolt, charging handle, magazine seating step a thump with a surface top: grit on concrete, a ringing partial on metal, a dead thud on dirt impact the same shape shorter and harder, ringing on steel game.audio.audio plays them through 24 pooled voices, subscribed to the same SHOT and IMPACT events the rest of the game publishes, so a shot is one event producing recoil, flash, casing and sound rather than four systems agreeing by luck. Positional: a shot plays from the muzzle, an impact from where it landed. Reload sounds are emitted per stage as the stage passes, so the catch lands with the hand and the seat lands with the ammunition changing. Footsteps are driven by distance covered, not a timer, so walk/sprint/crouch differ without being told which they are. Verified by the engine own audio readout: device open at 48kHz, audibleCount 1; the shot playing at 0.32s from the muzzle at 0.93m and gain 1.0, an impact at the 60m target at gain 0.52. --- optic: the sight can be looked through The root cause was geometry, not the camera: the optic was a SOLID 34x34mm box with a second solid box on top, and its lens used a painted-steel material. There was no hole and no glass, so there was nothing to see through. A sight is four walls around an open bore closed at each end by a transparent element. Rebuilt that way - 24mm bore inside a 36mm housing - with the reticle on the rear element, because a reflex dot is a reflection in the plane the eye looks through and putting it there is what makes it belong to the sight rather than floating in front of it. The magnified optic is built the same way with ring walls and real objective and ocular bells. Irons got a real rear aperture with a gap between two posts and a guarded front post. Three materials added: a transparent tinted lens, a nearly clear front element, and an emissive reticle. One real bug found in the process: the assembly is drawn at 0.78 scale, so a child offset is scaled too, and ADS was subtracting the UNSCALED sight height - which put the bore 1.5cm below the eye ray. Now scaled with the assembly. Verified by capture while holding ADS: the housing reads as a dark frame with the street and buildings visible through the bore and the reticle inside it. --- hands: join the forearm to the glove The arm root was placed independently of where the glove ends: the glove cuff sat at holder z 0.140 and the forearm wrist piece at 0.248, which is 10.8cm of empty air between them and exactly the detached wrist that was reported. The arm root now sits at the glove's own cuff station, so the forearm's 58mm wrist tucks inside the 70mm cuff with the glove bridge overlapping both. --- hands: limbs are round primitives, not boxes Every limb in the view model was a cube, and a finger or forearm made of boxes can only ever read as a slab however well it is posed. The engine ships capsule, cylinder and rounded_box meshes and none of them were being used. Fingers are now capsules (rounded tips, which is what a fingertip is), the wrist and forearm are tapering cylinders, the elbow a capsule. The animation node and the mesh are two entities deliberately: the node carries the chain rotation that setFingerCurl drives, the mesh child carries the 90-degree correction turning a Y-length primitive into a Z-length one. Folding them together would rotate the mesh out of line on every curl. Verified by capture: the weapon reads as a rifle - grip, receiver, barrel, handguard, magazine, stock - with a red dot visible in the sight, against a street of brick elevations, glass, sandbags and crossings. Still box-shaped in frame: the sleeve roll and the palm, which were not converted. --- hands: palm, wrist, cuff and sleeve are rounded boxes, not cubes Twelve more pieces off cubes - palm, palm heel, thenar, back of hand, knuckle plate, palm patch, wrist, cuff, cuff strap, glove bridge and the sleeve roll. rounded_box rounds every corner and needs no axis correction, where a cylinder would have needed one per part. --- hands: take the forearm out of frame The arm was never really too square - it was too PRESENT. 29cm of forearm held 30cm from the eye fills a corner of the screen no matter how round its corners are. Shortened to a real 26cm wrist-to-elbow and hung at a steeper pitch so the elbow leaves the bottom of the frame instead of lying across it. Verified by capture: the tan slab is gone from the frame entirely and the weapon reads cleanly - receiver, red-dot with its red housing, barrel, stock - against a brick building with a glass curtain wall, crossings and cover. Over-corrected: the hand is now out of frame as well as the arm, so nothing of the player's hands is visible at the hip. And a capture of the district shows a detached chunk of brick geometry with a beam floating in the sky at upper left, which is real broken geometry and is not a parapet - it is not yet located. --- materials: the weapon and glove read against the scene Both were near-black on a mid-grey street, so they rendered as silhouettes and the glove was invisible against the weapon it was holding - the hand was there the whole time, unreadable by value rather than absent. Gun polymer 0.030 -> 0.062, steel 0.075 -> 0.135, glove 0.045 -> 0.085, skin 0.42 -> 0.50. Roughness scaled so the metal keeps its sheen instead of going flat. Verified by capture: the street now reads as a place - brick elevations with courses, a glass curtain wall, crossings on wet asphalt, sandbags, barriers, a lamp, long shadows - and the weapon is legible in the lower right instead of a black shape. Still open: a detached brick slab floats above the road at centre frame. It is real geometry, it is not in the district mount above head height near the centre lane, and it is not yet located. --- gunplay: no one is ever stranded with an empty gun A player who had spent the magazine and the reserve was holding a weapon that refused to fire with no feedback and no way back - which read as broken shooting when it was actually a legitimate empty state with no recovery. Spawning (and any loadout change) now fills every combat weapon from its own magSize and reserve. An empty trigger pull with rounds still in reserve starts a reload as before; a pull with nothing left answers with the dry hammer at a civilised rate rather than silence. Verified: drained to 0/0, trigger answered dry_fire twice, spawn refilled to 30/210, and the weapon fired again to 27. --- audio: static clip references, so the world can actually be published The clip lookup resolved a computed identity - asset.resolve('game.audio.clips.' .. key, ...) - which cannot be statically pinned, so the world failed the publish gate and could not be shared or played by anyone else. Nineteen clips named literally now. --- enemy: soldiers spawn into the world Six enemy soldiers on the ground down-range, built from round primitives - capsules for limbs, rounded boxes for the torso and vest, a sphere for the skull - at metric proportions (1.80m tall, head 1.65m, hips 0.92m). Each part registers in the SAME impact lookup the training plates use, so one raycast resolves a hit on a paper target and a hit on a soldier's skull through one path, and a kill scores and feeds the kill event. AI: perception is a real line-of-sight raycast from the soldier's eyes to the player's, so cover is cover; states patrol / engage / search / dead; turn rate so nothing snaps; reaction time before the first shot; bursts with pauses; accuracy that falls off with range; and its own shots are real traces, so a soldier cannot shoot through a wall. Three bugs found and fixed on the way: - the uniform material was addressed under the wrong folder, which threw in awake and disabled the whole component (0 soldiers, silently); - patrol picked a wander point and clamped it to the map edge, so a soldier reaching the boundary re-picked a point centimetres away and jammed there; posts are now drawn around the soldier's own sector; - a record built before existed threw every frame and stopped update before movement ran. VERIFIED: six soldiers exist in the world with torso and helmet geometry, zero errors from the bot code, and one is visible in a capture standing on the street. NOT VERIFIED: that they move - they measured 0.00m across a 3s window. --- multiplayer-only: remove the bots; implement Q/E lean BOTS REMOVED. The bots.module folder is deleted and every reference is gone: the require, the spawner, its spawn table, the per-frame AI tick and the bot-specific scoring branch. Zero references remain in the director. The training range is untouched - plates are not AI and the game is for people. LEAN IMPLEMENTED. Q and E were bound to lean_left / lean_right several passes ago and nothing consumed them, which is exactly what 'bound but not implemented' means from the player side. The gunplay component now publishes Core.State.wantLean from those inputs and the player controller consumes it. - smoothed with an asymmetric rate: entering a lean is quick, leaving it is a touch softer, which is how a body shifting its weight reads - 15 degrees of roll and 19cm of lateral offset - a short trace sideways from the head decides how much room there is, so a player against a wall gets no lean rather than a camera through geometry - applied to the weapon, hands and sight picture TOGETHER - they are one object being held, and a lean that moved only the weapon would read as the gun sliding out of the player's grip VERIFIED in play by driving the real bindings: at rest 0.0000, holding Q -0.9999, released -0.0009, holding E +0.9999, settled +0.0002, and firing afterwards still consumes ammunition (30 -> 28). NOT applied to camera rotation: the builtin first-person behaviour owns the rig transform and rewrites it every frame, so a roll written there is discarded. The lean is on the assembly, which is the part of it the player can see. --- player: give the player a visible body The avatar carried Humanoid, Locomotion, PlayerAvatar and CharacterController - every system it needs - and NO Model component, so there was no geometry to draw and the player was invisible to every other player in the world. The builtin humanoid bundle that was supposed to supply it reports 'the root entity left the world while this bundle was being composed onto it' and leaves the body empty. The body is now built in the scene: a CharacterController for the mover and a body of round primitives at metric proportions measured from the feet up - 1.80m to the crown, hips at 0.92, shoulders at 1.44 - with legs, arms, torso, plate carrier, a head as its OWN entity (the hit zone that matters most, and named so a shot can address it) and a helmet. Every peer clones the prototype, which is what makes one player visible to another. VERIFIED: the geometry exists with Model components and the build reports zero errors. NOT YET VERIFIED VISUALLY - my capture framed a training target rather than the player, so I have confirmed this by data and not by pixels. --- player: limbs run down the body, not across it The limb helper rotated every capsule 90 degrees, which turns its length from Y to Z. That is right for a finger reaching out from a hand and wrong for a leg or an arm, which run down - so the figure came apart into stacked slabs. Confirmed by reading the nodes back: zero rotation now, length on Y. VERIFIED RENDERING: capturing the body shows legs, torso, arms, head, helmet and the weapon, all present with geometry, and the limbs vertical. STILL WRONG: vertical gaps remain between the parts - the head floats about 12cm clear of the torso and the torso about the same above the legs - so the figure reads as stacked pieces rather than one body. The y stations in build.luau need closing up. Not fixed, and visible in the capture. --- fix: a sealed entity ref cannot carry custom fields, and the body gaps are closed REGRESSION FIXED. The segPart helper assigned node.mesh = m. Entity refs are sealed - they carry only position/rotation/scale and change everything else through a call - so that line threw inside buildHand and took the ENTIRE first-person view model with it. Nothing read the field. Removing it restores the weapon and hands, confirmed by capture: the rifle with its red-dot sits in the lower right again. BODY GAPS CLOSED. The player figure had 12cm holes at the hips and the neck, so it read as stacked slabs. Legs now run from the ground to the torso underside (y 0.50, length 1.00), the head sits on the shoulders (y 1.57, 0.225 across) with the helmet down onto it (y 1.63), and the arms hang shoulder to hip (length 0.62). Verified by reading the nodes back: head y 1.57 / 0.225, torso y 1.22, leg y 0.50. OBSERVED: the multiplayer relay is INTERMITTENT, not fixed - it connected earlier this session with zero packet loss and is now failing its WebTransport handshake repeatedly. --- enemy: soldiers with tactical AI; ui: working HUD and full menu; player: derived view-model grip, health and respawn; perf: fix per-frame scene scan --- enemy: soldiers with tactical AI over the district; ui: working HUD plus full menu, loadout, settings, pause; player: derived view-model grip, health, death and respawn; perf: drop the per-frame scene scan --- menu: working title, loadout, settings, audio, controls and pause over a live district backdrop; wire component callbacks; match clock arms on the phase edge; centre the view model --- audio: bake the sound bank durably to the right identity — every clip was empty and every shot was silent; district: dress every street from a hashed scatter; enemy: fix the sight trace reading the player's own body as cover --- materials: render the missing previews
01M3WBH0RJQHDVB8R3FK4T9ZWG0e2867bfe3Browse filesCompare from here