feat: bigger characters (16 sub-bodies), wider terminal viewport

- Entity: 16 sub-bodies (was 7), radius 0.7 (was 0.4), full humanoid
  shape: head, shoulders, torso, arms, hips, legs, feet
- Terminal: viewport up to 250x80 (was 120x50), uses full terminal size
- Camera: uses renderer viewport dimensions instead of hardcoded values
- Physics: constraint correction clamped to 0.5 cells max, 8 substeps
  (was 4), gravity 0.04 (was 0.08), collision pass after each constraint
  iteration to prevent tunneling with larger bodies
- Player: move_speed 0.3, jump_force 1.2 for bigger body
- Spawn: 6 cells above surface (was 4) for taller body
This commit is contained in:
Emil
2026-06-20 21:27:11 +03:00
parent 7f4b1dde5e
commit 9fe7137e45
8 changed files with 349 additions and 316 deletions
+9 -5
View File
@@ -13,13 +13,17 @@ fn setup_empty() -> GameSession {
fn player_falls_and_lands() {
let mut s = GameSession::new_seeded(42);
s.init_empty();
s.clear_area(120, 128, 10, 5);
s.perform_action(&AiAction::FillRect { x: 118, y: 132, w: 14, h: 10, material: "stone".into() });
s.step(30);
s.clear_area(115, 120, 20, 10);
s.perform_action(&AiAction::FillRect { x: 110, y: 130, w: 30, h: 15, material: "stone".into() });
s.step(40);
let player = s.get_player().expect("player should exist");
assert!(player.alive, "player should be alive");
assert!(player.pos[1] < 132.0, "player should land on stone at y=132, got y={}", player.pos[1]);
assert!(player.pos[1] > 125.0, "player should have fallen from center");
let y = player.pos[1];
assert!(y < 140.0, "player should not fall through stone floor, got y={}", y);
s.step(20);
let player2 = s.get_player().expect("player should exist");
let dy = (player2.pos[1] - y).abs();
assert!(dy < 2.0, "player should have stopped falling (dy={:.2}), y={} -> {}", dy, y, player2.pos[1]);
}
#[test]
+1 -1
View File
@@ -87,7 +87,7 @@ fn pipe_protocol_init_and_step() {
let mut output = String::new();
let stdout = child.stdout.as_mut().expect("failed to open stdout");
use std::io::Read;
let mut buf = [0u8; 4096];
let mut buf = [0u8; 65536];
let n = stdout.read(&mut buf).expect("read");
output.push_str(&String::from_utf8_lossy(&buf[..n]));