From 15f254e53f01dc3b672696ebd31da27082431838 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:18:55 +0100 Subject: [PATCH] jak2 gsrc --- goal_src/jak2/engine/camera/cam-layout.gc | 2 +- goal_src/jak2/engine/camera/cam-master.gc | 4 +- goal_src/jak2/engine/camera/cam-states-dbg.gc | 20 +- goal_src/jak2/engine/camera/cam-states.gc | 4 +- goal_src/jak2/engine/camera/camera.gc | 18 +- goal_src/jak2/engine/collide/collide-touch.gc | 2 +- .../jak2/engine/common_objs/blocking-plane.gc | 18 +- .../jak2/engine/common_objs/collectables.gc | 102 +++---- goal_src/jak2/engine/common_objs/crates.gc | 4 +- .../jak2/engine/common_objs/dark-eco-pool.gc | 2 +- goal_src/jak2/engine/common_objs/water.gc | 26 +- goal_src/jak2/engine/debug/default-menu.gc | 37 ++- goal_src/jak2/engine/debug/editable-player.gc | 14 +- goal_src/jak2/engine/debug/editable.gc | 6 +- .../jak2/engine/debug/nav/nav-graph-editor.gc | 7 +- goal_src/jak2/engine/game/effect-control.gc | 2 +- goal_src/jak2/engine/geometry/cylinder.gc | 4 +- goal_src/jak2/engine/gfx/foreground/ripple.gc | 16 +- goal_src/jak2/engine/gfx/hw/video.gc | 16 +- goal_src/jak2/engine/gfx/mood/mood-funcs.gc | 14 +- goal_src/jak2/engine/gfx/mood/mood-funcs2.gc | 18 +- goal_src/jak2/engine/gfx/mood/mood-tables2.gc | 249 ++++++++++-------- goal_src/jak2/engine/gfx/mood/mood.gc | 24 +- goal_src/jak2/engine/gfx/mood/time-of-day.gc | 13 +- goal_src/jak2/engine/gfx/ocean/ocean-mid.gc | 4 +- goal_src/jak2/engine/gfx/ocean/ocean-near.gc | 4 +- .../jak2/engine/gfx/ocean/ocean-texture.gc | 6 +- goal_src/jak2/engine/gfx/ocean/ocean.gc | 20 +- .../engine/gfx/sprite/particles/sparticle.gc | 4 +- .../jak2/engine/gfx/sprite/sprite-distort.gc | 10 +- .../jak2/engine/gfx/sprite/sprite-glow.gc | 2 +- goal_src/jak2/engine/physics/dynamics-h.gc | 6 +- goal_src/jak2/engine/physics/rigid-body.gc | 18 +- goal_src/jak2/engine/physics/trajectory.gc | 4 +- goal_src/jak2/engine/scene/scene.gc | 18 +- goal_src/jak2/engine/sound/gsound.gc | 184 ++++++++----- .../jak2/engine/target/board/board-states.gc | 15 +- .../jak2/engine/target/board/target-board.gc | 14 +- .../engine/target/collide-reaction-target.gc | 2 +- .../jak2/engine/target/gun/gun-yellow-shot.gc | 2 +- goal_src/jak2/engine/target/logic-target.gc | 3 +- goal_src/jak2/engine/target/mech/mech-part.gc | 2 +- .../jak2/engine/target/mech/mech-states.gc | 16 +- goal_src/jak2/engine/target/surface-h.gc | 9 +- goal_src/jak2/engine/target/target-anim.gc | 8 +- goal_src/jak2/engine/target/target-carry.gc | 2 +- goal_src/jak2/engine/target/target-darkjak.gc | 2 +- goal_src/jak2/engine/target/target-death.gc | 35 ++- goal_src/jak2/engine/target/target-gun.gc | 4 +- goal_src/jak2/engine/target/target-swim.gc | 4 +- goal_src/jak2/engine/target/target-tube.gc | 12 +- .../jak2/engine/target/target-turret-shot.gc | 2 +- goal_src/jak2/engine/target/target-turret.gc | 2 +- goal_src/jak2/engine/target/target-util.gc | 10 +- goal_src/jak2/engine/target/target.gc | 8 +- goal_src/jak2/engine/target/target2.gc | 19 +- goal_src/jak2/engine/ui/hud.gc | 2 +- goal_src/jak2/engine/ui/minimap.gc | 27 +- goal_src/jak2/engine/ui/text.gc | 26 +- goal_src/jak2/engine/util/smush-control-h.gc | 46 ++-- goal_src/jak2/engine/util/sync-info.gc | 6 +- goal_src/jak2/levels/atoll/atoll-obs.gc | 20 +- .../levels/castle/boss/casboss-texture.gc | 4 +- .../jak2/levels/castle/boss/castle-baron.gc | 2 +- goal_src/jak2/levels/castle/castle-texture.gc | 2 +- .../jak2/levels/castle/roboguard-level.gc | 6 +- goal_src/jak2/levels/city/bombbot/bombbot.gc | 4 +- goal_src/jak2/levels/city/common/nav-graph.gc | 8 +- goal_src/jak2/levels/city/common/trail.gc | 2 +- goal_src/jak2/levels/city/ctywide-obs.gc | 14 +- .../jak2/levels/city/onintent/onin-game.gc | 10 +- .../jak2/levels/city/palace/ctypal-obs.gc | 27 +- .../jak2/levels/city/slums/kor/kid3-course.gc | 2 +- .../jak2/levels/city/slums/kor/kor3-course.gc | 2 +- .../city/traffic/citizen/citizen-norm.gc | 2 +- .../levels/city/traffic/citizen/citizen.gc | 24 +- .../levels/city/traffic/citizen/civilian.gc | 4 +- .../jak2/levels/city/traffic/citizen/guard.gc | 22 +- .../city/traffic/citizen/metalhead-flitter.gc | 8 +- .../traffic/citizen/metalhead-predator.gc | 14 +- .../levels/city/traffic/traffic-engine.gc | 24 +- .../jak2/levels/city/traffic/vehicle/bike.gc | 86 +++--- .../jak2/levels/city/traffic/vehicle/car.gc | 70 ++--- .../city/traffic/vehicle/vehicle-effects.gc | 12 +- .../city/traffic/vehicle/vehicle-guard.gc | 2 +- .../city/traffic/vehicle/vehicle-physics.gc | 8 +- .../city/traffic/vehicle/vehicle-util.gc | 12 +- .../levels/city/traffic/vehicle/vehicle.gc | 6 +- .../jak2/levels/common/ai/sig/sig-plasma.gc | 2 +- .../jak2/levels/common/ai/sig/sig-states.gc | 10 +- goal_src/jak2/levels/common/ai/sig/sig.gc | 6 +- goal_src/jak2/levels/common/elec-gate.gc | 35 +-- .../jak2/levels/common/enemy/centurion.gc | 2 +- goal_src/jak2/levels/common/enemy/flitter.gc | 2 +- .../common/enemy/hover/crimson-guard-hover.gc | 8 +- .../common/enemy/hover/hover-nav-control.gc | 6 +- .../common/enemy/hover/hover-nav-edit.gc | 2 +- .../jak2/levels/common/enemy/hover/wasp.gc | 6 +- goal_src/jak2/levels/common/enemy/spyder.gc | 5 +- .../jak2/levels/common/entities/gun-buoy.gc | 12 +- .../jak2/levels/common/entities/spydroid.gc | 8 +- .../jak2/levels/common/guard-projectile.gc | 2 +- .../levels/common/metalhead-projectile.gc | 2 +- .../jak2/levels/common/race/race-manager.gc | 7 +- goal_src/jak2/levels/common/race/race-mesh.gc | 4 +- .../jak2/levels/consite/consite-scenes.gc | 2 +- goal_src/jak2/levels/dig/dig-digger.gc | 2 +- goal_src/jak2/levels/dig/dig3-obs.gc | 8 +- goal_src/jak2/levels/drill/drill-baron.gc | 14 +- goal_src/jak2/levels/drill/drill-obs.gc | 18 +- goal_src/jak2/levels/drill/ginsu.gc | 2 +- goal_src/jak2/levels/forest/forest-obs.gc | 44 ++-- goal_src/jak2/levels/forest/pegasus.gc | 96 +++---- goal_src/jak2/levels/forest/predator.gc | 41 +-- goal_src/jak2/levels/forest/wren.gc | 14 +- .../fortress/dump/fort-robotank-turret.gc | 10 +- .../levels/fortress/dump/fort-robotank.gc | 4 +- .../levels/fortress/rescue/forrescb-obs.gc | 39 +-- goal_src/jak2/levels/intro/intro-scenes.gc | 4 +- goal_src/jak2/levels/mountain/mountain-obs.gc | 30 +-- goal_src/jak2/levels/mountain/rhino.gc | 2 +- .../jak2/levels/nest/boss/metalkor-extras.gc | 10 +- .../jak2/levels/nest/boss/metalkor-states.gc | 8 +- .../jak2/levels/nest/boss/nestb-scenes.gc | 2 +- .../jak2/levels/palace/boss/squid-setup.gc | 37 +-- .../jak2/levels/palace/boss/squid-states.gc | 2 +- .../jak2/levels/palace/cable/palcab-obs.gc | 61 ++--- .../levels/palace/throne/metalkor-texture.gc | 4 +- goal_src/jak2/levels/ruins/mechtest-obs.gc | 22 +- goal_src/jak2/levels/ruins/pillar-collapse.gc | 12 +- goal_src/jak2/levels/ruins/rapid-gunner.gc | 24 +- goal_src/jak2/levels/sewer/sewer-obs2.gc | 5 +- goal_src/jak2/levels/stadium/stadium-obs.gc | 8 +- goal_src/jak2/levels/tomb/widow-baron.gc | 14 +- goal_src/jak2/levels/tomb/widow-extras.gc | 10 +- goal_src/jak2/levels/under/jellyfish.gc | 17 +- goal_src/jak2/levels/under/under-obs.gc | 2 +- goal_src/jak2/levels/under/underb-master.gc | 18 +- 138 files changed, 1206 insertions(+), 1076 deletions(-) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index 7b40b58516..c8d572f5a8 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -1042,7 +1042,7 @@ (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index 4fabe271e3..63edb3655c 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -214,10 +214,10 @@ (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) - (let ((f0-26 (* 0.05 f30-0))) + (let ((f0-26 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) ) ) diff --git a/goal_src/jak2/engine/camera/cam-states-dbg.gc b/goal_src/jak2/engine/camera/cam-states-dbg.gc index 8062a4e738..9d741277e9 100644 --- a/goal_src/jak2/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak2/engine/camera/cam-states-dbg.gc @@ -47,10 +47,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -104,8 +104,8 @@ (let ((f30-0 (vector-length a0-7))) (cond (#f - (let* ((f28-0 (* 0.01 f30-0 (-> v1-0 x))) - (f26-0 (* 0.01 f30-0 (-> v1-0 y))) + (let* ((f28-0 (* (/ f30-0 100) (-> v1-0 x))) + (f26-0 (* (/ f30-0 100) (-> v1-0 y))) (f0-5 f28-0) (f0-7 (* f0-5 f0-5)) (f1-2 f26-0) @@ -348,16 +348,16 @@ ((and (not s3-0) (cpad-hold? arg3 r2)) (cond ((cpad-hold? arg3 l2) - (set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0)))) - (set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-60)))) + (set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0)))) + (set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-60)))) ) (else (set! (-> arg0 y) (- (-> arg0 y) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg0 x) (- (-> arg0 x) (* (- f0-60) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14)) - (+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14)) + (+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14)) + (+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14)) ) ((and (not s3-0) (cpad-hold? arg3 l2)) (+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed))) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index ccc6428fb4..9b5ab1dbd8 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -2285,7 +2285,7 @@ (set! f28-0 0.0) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2308,7 +2308,7 @@ (let ((f0-23 f26-0)) (when (< f26-0 0.0) (let ((f0-26 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)) ) ) (set! f0-23 (fmin 0.75 f0-26)) diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index 3732e5a77a..ca33daaa9d 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -265,7 +265,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -734,7 +734,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -764,7 +764,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) - (f0-6 (* 0.5 f0-5)) + (f0-6 (/ f0-5 2)) (f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0))) ) (let ((f1-14 (vector-dot s2-0 s3-0))) @@ -837,7 +837,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) @@ -1213,7 +1213,7 @@ (vector-! s2-0 s2-0 (-> arg0 follow-off)) (vector-float*! s2-0 s2-0 f0-23) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else @@ -1439,7 +1439,7 @@ (let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector))))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 vector)) - (let ((f0-7 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-7 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-11 f0-7)) (.mov vf2 v1-11) @@ -1472,7 +1472,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 vector 1)) - (let ((f0-16 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-16 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-32 f0-16)) (.mov vf2 v1-32) @@ -1498,7 +1498,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 vector 1)) - (let ((f0-26 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-26 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-26) ) ) @@ -1657,7 +1657,7 @@ (set! sv-256 vector-into-frustum-nosmooth!) (set! sv-272 s1-0) (set! sv-288 arg1) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) (cond diff --git a/goal_src/jak2/engine/collide/collide-touch.gc b/goal_src/jak2/engine/collide/collide-touch.gc index 1047a105f5..e7da1bb367 100644 --- a/goal_src/jak2/engine/collide/collide-touch.gc +++ b/goal_src/jak2/engine/collide/collide-touch.gc @@ -487,7 +487,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) diff --git a/goal_src/jak2/engine/common_objs/blocking-plane.gc b/goal_src/jak2/engine/common_objs/blocking-plane.gc index ecafe4dccb..c010c0f01f 100644 --- a/goal_src/jak2/engine/common_objs/blocking-plane.gc +++ b/goal_src/jak2/engine/common_objs/blocking-plane.gc @@ -112,11 +112,11 @@ ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) - (+! (-> s2-1 trans y) (* 0.5 height)) + (+! (-> s2-1 trans y) (/ height 2)) (vector-! (the-as vector (-> s1-0 vector)) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0))) - (set! (-> s2-1 scale x) (* 0.00024414062 f30-1)) - (set! (-> s2-1 scale y) (* 0.00024414062 height)) + (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s2-1 scale y) (/ height METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (set! (-> s1-0 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1)) @@ -124,7 +124,7 @@ (matrix->quaternion (-> s2-1 quat) s1-0) (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) - (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 height))) + (set! (-> v1-20 y) (* 0.00024414062 (/ height 2))) (set! (-> v1-20 z) 0.0) (let ((f0-17 0.5) (f1-7 (* f30-1 f30-1)) @@ -160,11 +160,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) (f30-0 (res-lump-float (-> this entity) 'height :default 122880.0)) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 21b6745e7f..0799e6629c 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -880,7 +880,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) @@ -1014,7 +1014,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part fade) (* 0.0033333334 f0-1)) + (set! (-> self part fade) (/ f0-1 300)) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1240,11 +1240,11 @@ (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1256,11 +1256,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1272,11 +1272,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1288,11 +1288,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1304,11 +1304,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) (none) ) @@ -1344,16 +1344,17 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) (none) ) (defmethod deactivate ((this eco-pill)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (+! (-> *game-info* live-eco-pill-count) -1) ((method-of-type collectable deactivate) this) (none) @@ -1396,6 +1397,7 @@ This commonly includes things such as: (defmethod run-logic? ((this money)) + "Should this process be run? Checked by execute-process-tree." (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -1410,6 +1412,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this money)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) (case (-> this pickup-type) (((pickup-type gem)) @@ -1546,11 +1549,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -1629,6 +1632,7 @@ This commonly includes things such as: (defmethod deactivate ((this gem)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (+! (-> *game-info* live-gem-count) -1) (call-parent-method this) (none) @@ -1980,11 +1984,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -2234,11 +2238,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) (set! (-> this type) (cond ((= (the-as uint v1-1) 3) @@ -2557,14 +2561,14 @@ This commonly includes things such as: ) ((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red))) (set! s2-0 (pickup-type ammo-red)) - (set! f30-0 (* 0.5 f30-0)) + (set! f30-0 (/ f30-0 2)) ) ((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue))) (set! s2-0 (pickup-type ammo-blue)) ) ((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark))) (set! s2-0 (pickup-type ammo-dark)) - (set! f30-0 (* 0.1 f30-0)) + (set! f30-0 (/ f30-0 10)) ) (else (set! s2-0 (pickup-type eco-pill-dark)) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index a2856841c5..37ca75ca2f 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -1291,9 +1291,9 @@ (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) diff --git a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc index ce341eba6d..5f099e83f1 100644 --- a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc +++ b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc @@ -301,7 +301,7 @@ (f0-9 (fmax -1.0 (fmin 1.0 f0-7))) ) (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f0-9 2))) ) ) ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 14fdcf32f4..774c4f9ce0 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -830,7 +830,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f28-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size)) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size)) @@ -1089,7 +1089,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flags spawn-drip)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -1144,9 +1144,9 @@ (set! (-> *part-id-table* 512 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0))) - (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0))) @@ -1160,11 +1160,11 @@ (set! (-> *part-id-table* 516 init-specs 10 random-rangef) (* 13.653334 (* 2.4 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 random-rangef) (* 13.653334 (* 2.4 f0-0))) - (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (* 0.5 f0-0)) - (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (/ f0-0 2)) + (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2))) + (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 520 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0))) (set! (-> *part-id-table* 520 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 520 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0))) @@ -1173,7 +1173,7 @@ (set! (-> *part-id-table* 520 init-specs 11 random-rangef) (* 13.653334 (* 2.0 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (* 0.5 f0-0)) + (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (/ f0-0 2)) (set! (-> *part-id-table* 517 init-specs 2 initial-valuef) (* 1.2 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 initial-valuef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 random-rangef) (* 13.653334 (* 2.0 f0-0))) @@ -1196,10 +1196,10 @@ (set! (-> *part-id-table* 515 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 515 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 514 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 514 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0))) @@ -1302,7 +1302,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 arg0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 arg0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f30-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f30-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) arg3) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) arg3) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 728b428cd1..be9a791186 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -298,13 +298,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 7)) + (/ (-> *subdivide-settings* close 7) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 7)) + (/ (-> *subdivide-settings* far 7) METER_LENGTH) arg3 ) ) @@ -559,7 +559,7 @@ (if (= arg1 (debug-menu-msg press)) (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) ) - (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + (/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH) ) ) @@ -974,7 +974,7 @@ ) ) ) - (* 0.00024414062 f1-2) + (/ f1-2 METER_LENGTH) ) ) (else @@ -1011,7 +1011,7 @@ (set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-0) ) ) - (* 0.00024414062 f0-0) + (/ f0-0 METER_LENGTH) ) ) (else @@ -2550,7 +2550,7 @@ (set! (-> gp-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists x)) + (/ (-> gp-0 dists x) METER_LENGTH) ) (else (empty) @@ -2581,7 +2581,7 @@ (set! (-> gp-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists w)) + (/ (-> gp-0 dists w) METER_LENGTH) ) (else (empty) @@ -4362,10 +4362,7 @@ ,(lambda () (let ((v1-1 (process-spawn-function process (lambda () (set-master-mode 'game) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (until #f (format *stdcon* "press x clear map, press circle cancel~%") @@ -5252,13 +5249,13 @@ fog-dists x ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists x ) + METER_LENGTH ) ) (set! (-> *overide-mood-fog-table* @@ -5267,13 +5264,13 @@ fog-dists y ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists y ) + METER_LENGTH ) ) ) @@ -5286,10 +5283,10 @@ (dotimes (v1-1 8) (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists y) METER_LENGTH) ) ) #f @@ -5616,10 +5613,10 @@ (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) ) @@ -5643,7 +5640,7 @@ (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) (function "Reload Banks" #f sound-bank-reload) (function "List Sounds" #f ,(lambda () (list-sounds) (none))) - ;(function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) + (function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) ) ) ) diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 1db1b003d8..ac953b40c9 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -642,7 +642,7 @@ ) (else (vector-! s5-1 (edit-get-trans s1-2) s4-1) - (let ((f0-9 (* 0.00390625 f30-1 (vector-length s5-1)))) + (let ((f0-9 (* (/ f30-1 256) (vector-length s5-1)))) (set! f0-6 (fmax -40960.0 (fmin 40960.0 f0-9))) ) (set! (-> arg0 move-speed) f0-6) @@ -692,7 +692,7 @@ ) (else (vector-! s5-2 (edit-get-trans s1-3) s4-2) - (let ((f0-21 (* 0.00390625 f30-2 (vector-length s5-2)))) + (let ((f0-21 (* (/ f30-2 256) (vector-length s5-2)))) (set! f0-18 (fmax -40960.0 (fmin 40960.0 f0-21))) ) (set! (-> arg0 move-speed) f0-18) @@ -742,7 +742,7 @@ ) (else (vector-! s5-3 (edit-get-trans s1-4) s4-3) - (let ((f0-32 (* 0.00390625 f30-3 (vector-length s5-3)))) + (let ((f0-32 (* (/ f30-3 256) (vector-length s5-3)))) (set! (-> arg0 move-speed) f0-32) (set! f0-29 (fmax -40960.0 (fmin 40960.0 f0-32))) ) @@ -1437,23 +1437,23 @@ ) ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate ((this editable-player) (arg0 int)) +(defmethod relocate ((this editable-player) (offset int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) - (set! (-> v1-0 relocating-offset) arg0) + (set! (-> v1-0 relocating-offset) offset) ) (let ((v1-2 (-> this current))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> this current) arg0) + (&+! (-> this current) offset) ) ) - (the-as editable-player ((method-of-type process-drawable relocate) this arg0)) + (the-as editable-player ((method-of-type process-drawable relocate) this offset)) ) (defmethod editable-player-method-21 ((this editable-player)) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index a72db8aa65..e594f27671 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -1082,7 +1082,7 @@ (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) - (* 0.00024414062 (-> this radius)) + (/ (-> this radius) METER_LENGTH) ) (if (= (-> this direction w) 0.0) (format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0") @@ -1808,9 +1808,9 @@ ) ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate ((this editable-array) (arg0 int)) +(defmethod relocate ((this editable-array) (offset int)) (the-as editable-array (when (nonzero? (-> this selection)) - (let ((v0-0 (&+ (-> this selection) arg0))) + (let ((v0-0 (&+ (-> this selection) offset))) (set! (-> this selection) v0-0) v0-0 ) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 3b53d09b6d..1ee9ac8300 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -149,13 +149,14 @@ ) (defmethod deactivate ((this nav-graph-editor)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ((method-of-type process deactivate) this) (none) ) -(defmethod relocate ((this nav-graph-editor) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this nav-graph-editor) (offset int)) + (call-parent-method this offset) ) ;; WARN: Return type mismatch symbol vs none. @@ -1777,7 +1778,7 @@ (let ((gp-0 (-> self nav-graph edge-array data (-> self selected-index)))) (format *stdcon* "Density = ~F~%" (-> gp-0 density)) (logior! (-> gp-0 mysql-save-flag) (mysql-save-flag update)) - (+! (-> gp-0 density) (* 0.01 (-> *mouse* speedx))) + (+! (-> gp-0 density) (/ (-> *mouse* speedx) 100)) (if (< (-> gp-0 density) 0.0) (set! (-> gp-0 density) 0.0) ) diff --git a/goal_src/jak2/engine/game/effect-control.gc b/goal_src/jak2/engine/game/effect-control.gc index bb99aad853..d40b1d13d3 100644 --- a/goal_src/jak2/engine/game/effect-control.gc +++ b/goal_src/jak2/engine/game/effect-control.gc @@ -1143,7 +1143,7 @@ (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) - (the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel)))) + (the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15)))) 0 0 (sound-group sfx) diff --git a/goal_src/jak2/engine/geometry/cylinder.gc b/goal_src/jak2/engine/geometry/cylinder.gc index 8833ef406e..b1805faa9b 100644 --- a/goal_src/jak2/engine/geometry/cylinder.gc +++ b/goal_src/jak2/engine/geometry/cylinder.gc @@ -73,7 +73,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 8)) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) @@ -242,7 +242,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 7)) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) diff --git a/goal_src/jak2/engine/gfx/foreground/ripple.gc b/goal_src/jak2/engine/gfx/foreground/ripple.gc index ce0748a3dd..803cfa2f17 100644 --- a/goal_src/jak2/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak2/engine/gfx/foreground/ripple.gc @@ -26,9 +26,9 @@ (defun ripple-make-request ((waveform ripple-wave) (effect merc-effect)) "Iterate through [[*ripple-globals*]] `requests` looking for the one that matches the provided `effect` -If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`. - -NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!" + If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`. + + NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!" (let ((v1-1 (-> *ripple-globals* count)) (a2-1 (-> *ripple-globals* requests)) (a3-0 0) @@ -74,10 +74,10 @@ NOTE: There can only be 16 effects at a given time, NOOP if already at that limi (defun ripple-execute () "Iterate through [[*ripple-globals*]] requests, from the end to index `0` -For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table` -Then for each `waveform` apply the `effect` using `ripple-apply-wave-table` - -Once completed, all `requests` have been processed and the `count` is reset to `0`" + For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table` + Then for each `waveform` apply the `effect` using `ripple-apply-wave-table` + + Once completed, all `requests` have been processed and the `count` is reset to `0`" (when (-> *ripple-globals* count) (ripple-execute-init) (let ((gp-0 0) @@ -192,7 +192,7 @@ Once completed, all `requests` have been processed and the `count` is reset to ` (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) diff --git a/goal_src/jak2/engine/gfx/hw/video.gc b/goal_src/jak2/engine/gfx/hw/video.gc index 7239ac9736..f59e130f5e 100644 --- a/goal_src/jak2/engine/gfx/hw/video.gc +++ b/goal_src/jak2/engine/gfx/hw/video.gc @@ -11,11 +11,11 @@ (defun set-video-mode ((tv-format symbol)) "Set related settings to the video mode in the settings, [[*video-params*]] and the [[*video-mode*]] -`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1` - -Will also set a bunch of common settings related to profiling and the camera to finalize the switch - -@param tv-format Recognizes `ntsc` and `pal`" + `ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1` + + Will also set a bunch of common settings related to profiling and the camera to finalize the switch + + @param tv-format Recognizes `ntsc` and `pal`" (case tv-format (('ntsc) (set! (-> *setting-control* user-default display-dx) 0) @@ -42,7 +42,7 @@ Will also set a bunch of common settings related to profiling and the camera to (set! (-> *video-params* reset-video-mode) #t) (set! (-> *math-camera* isometric vector 1 y) 0.5) (set! (-> *math-camera* y-clip) 416.0) - (set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip))) + (set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2)) (set! *profile-y* 1848) (set! (-> *video-params* set-video-mode) #t) 0 @@ -56,7 +56,7 @@ Will also set a bunch of common settings related to profiling and the camera to (defun set-aspect-ratio ((aspect symbol)) "Set [[*video-params*]] aspect-ratio related settings based on the mode provided. -@param aspect Recognizes `aspect4x3` and `aspect16x9`" + @param aspect Recognizes `aspect4x3` and `aspect16x9`" (case aspect (('aspect4x3) (set! (-> *video-params* relative-x-scale) 1.0) @@ -78,7 +78,7 @@ Will also set a bunch of common settings related to profiling and the camera to (defun set-progressive-scan ((val symbol)) "Flip the progressive scan setting flag depending on the value provided -@param val The value to set the progressive scan flag to" + @param val The value to set the progressive scan flag to" (set! (-> *setting-control* user-default use-progressive-scan) val) 0 (none) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc index 9879af5f7d..0a476faffd 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc @@ -481,7 +481,7 @@ ) (cond ((< f0-3 15.0) - (set! (-> gp-1 blink) (* 0.06666667 f0-3)) + (set! (-> gp-1 blink) (/ f0-3 15)) ) ((< 45.0 f0-3) (set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3))) @@ -536,7 +536,7 @@ (set! (-> v1-12 r) 1.0) ) (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) - (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) + (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (/ f0-8 2)) 30.0 30.0) ) ) ) @@ -1304,7 +1304,7 @@ (let ((v1-1 (level-get *level* 'palent))) (when v1-1 (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) - (set! (-> (the-as palent-states v1-2) turret-value) (* 0.5 arg0)) + (set! (-> (the-as palent-states v1-2) turret-value) (/ arg0 2)) ) ) ) @@ -1385,9 +1385,9 @@ (defun update-village1-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) - (set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x))) - (set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x))) - (set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x))) + (set! (-> v1-0 0 dir0 extra x) (/ (-> v1-0 0 dir0 extra x) 2)) + (set! (-> v1-0 0 dir1 extra x) (/ (-> v1-0 0 dir1 extra x) 2)) + (set! (-> v1-0 0 dir2 extra x) (/ (-> v1-0 0 dir2 extra x) 2)) (set! (-> v1-0 0 ambi extra x) (* 0.75 (-> v1-0 0 ambi extra x))) ) ) @@ -1403,7 +1403,7 @@ (set! (-> arg0 times 6 w) (- 1.0 f0-0)) (set! (-> arg0 times 7 w) f0-0) (if (!= f0-0 0.0) - (set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0) + (set-filter-color! (- 1.0 (/ f0-0 4)) (- 1.0 (/ f0-0 2)) 1.0) ) ) (when (not (paused?)) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc index eca27e71d9..26042895a0 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc @@ -586,7 +586,7 @@ (if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500)) (+! f4-0 f0-8) ) - (let ((f0-10 (* 0.0006510417 f4-0))) + (let ((f0-10 (/ f4-0 1536))) (set! (-> arg0 times 2 w) f0-10) (set! (-> arg0 light-group 3 dir1 extra x) f0-10) ) @@ -625,7 +625,7 @@ (if (nonzero? (-> s5-0 spec-hog-2-on)) (set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19) ) - (set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19))) + (set! (-> arg0 times 3 w) (+ 0.5 (/ f0-19 1024))) ) (set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w)) (let ((v1-6 (mod v1-5 600))) @@ -638,7 +638,7 @@ (if (nonzero? (-> s5-0 spec-hiphog-on2)) (set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24) ) - (set! (-> arg0 times 4 w) (* 0.001953125 f0-24)) + (set! (-> arg0 times 4 w) (/ f0-24 512)) ) ) (else @@ -659,7 +659,7 @@ (if (nonzero? (-> s5-0 spec-clock-moon)) (set! (-> s5-0 spec-clock-moon initial-valuef) f0-31) ) - (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31))) + (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (/ f0-31 512))) ) ) (else @@ -667,7 +667,7 @@ (if (nonzero? (-> s5-0 spec-clock-sun)) (set! (-> s5-0 spec-clock-sun initial-valuef) f0-35) ) - (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35))) + (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (/ f0-35 1024))) ) ) ) @@ -2328,7 +2328,7 @@ ) (when (!= (-> gp-0 explosion) 0.0) (set! (-> arg0 times 7 w) (-> gp-0 explosion)) - (let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion))))) + (let ((f0-15 (- 1.0 (/ (-> gp-0 explosion) 2)))) (set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15)) (set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15)) (set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15)) @@ -2437,7 +2437,7 @@ ((< 0.0 (-> gp-1 flash)) (set! (-> gp-1 level) (-> gp-1 flash)) (set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0) - (set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame)))) + (set! (-> gp-1 flash) (- (-> gp-1 flash) (/ (-> *display* base-clock seconds-per-frame) 2))) (set! (-> gp-1 time) 0.0) ) (else @@ -2461,7 +2461,7 @@ (let ((f30-0 (vector-length (-> gp-1 pos)))) (set! (-> gp-1 dir quad) (-> gp-1 pos quad)) (vector-normalize! (-> gp-1 dir) 1.0) - (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0))))) + (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (/ f30-0 (meters 25)))))) ) (set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame)))) ) @@ -2560,7 +2560,7 @@ (set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise))) (when (not (paused?)) (seek! (-> gp-1 purple) 0.0 (* 4.0 (seconds-per-frame))) - (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple)))) + (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (/ (-> gp-1 purple) 5))) (+! (-> gp-1 rot) (* 16384.0 (seconds-per-frame))) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc index bfd30a8eb6..f82a2953c7 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc @@ -97,15 +97,18 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defun init-overide-table ((arg0 mood-table)) - (set! (-> arg0 mood-fog-table) (new 'debug 'mood-fog-table)) - (set! (-> arg0 mood-color-table) (new 'debug 'mood-color-table)) - (set! (-> arg0 mood-channel-group) *no-cloud-mood-channel-group*) - (set! (-> arg0 mood-direction-table) *mood-direction-table*) - (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) *mood-interp-table*) - (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) - (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) +(defun init-overide-table ((table mood-table)) + "Similar to [[init-mood-table]], does the bare minimum to setup the given [[mood-table]] + @param! table The table to initialize + @returns [[none]]" + (set! (-> table mood-fog-table) (new 'debug 'mood-fog-table)) + (set! (-> table mood-color-table) (new 'debug 'mood-color-table)) + (set! (-> table mood-channel-group) *no-cloud-mood-channel-group*) + (set! (-> table mood-direction-table) *mood-direction-table*) + (set! (-> table mood-sky-table) *mood-sky-table*) + (set! (-> table mood-interp-table) *mood-interp-table*) + (mem-copy! (the-as pointer (-> table mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) + (mem-copy! (the-as pointer (-> table mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (none) ) @@ -115,62 +118,62 @@ ;; WARN: Return type mismatch object vs none. (defun print-mood-tables () - "Print out the contents of the [[*overide-table*]]" + "Generates the GOAL code for defining the current state of [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) (the-as pointer *overide-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> *overide-table* mood-color-table)) (the-as pointer *overide-mood-color-table*) 256 ) - (dotimes (v1-2 8) + (dotimes (data-idx 8) (vector-float*! - (the-as vector (-> *overide-table* mood-fog-table data v1-2)) - (the-as vector (-> *overide-table* mood-fog-table data v1-2)) - (-> *overide-table* mood-fog-table data v1-2 fog-color w) + (the-as vector (-> *overide-table* mood-fog-table data data-idx)) + (the-as vector (-> *overide-table* mood-fog-table data data-idx)) + (-> *overide-table* mood-fog-table data data-idx fog-color w) ) (vector-float*! - (the-as vector (-> *overide-table* mood-color-table data v1-2)) - (the-as vector (-> *overide-table* mood-color-table data v1-2)) - (-> *overide-table* mood-color-table data v1-2 lgt-color w) + (the-as vector (-> *overide-table* mood-color-table data data-idx)) + (the-as vector (-> *overide-table* mood-color-table data data-idx)) + (-> *overide-table* mood-color-table data data-idx lgt-color w) ) (vector-float*! - (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) - (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) - (-> *overide-table* mood-color-table data v1-2 amb-color w) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32))) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32))) + (-> *overide-table* mood-color-table data data-idx amb-color w) ) - (set! (-> *overide-table* mood-fog-table data v1-2 fog-color w) 128.0) - (set! (-> *overide-table* mood-color-table data v1-2 lgt-color w) 0.0) - (set! (-> *overide-table* mood-color-table data v1-2 amb-color w) 1.0) + (set! (-> *overide-table* mood-fog-table data data-idx fog-color w) 128.0) + (set! (-> *overide-table* mood-color-table data data-idx lgt-color w) 0.0) + (set! (-> *overide-table* mood-color-table data data-idx amb-color w) 1.0) ) (format 0 "(define *overide-mood-color-table*~%") (format 0 " (new 'static 'mood-color-table~%") (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") - (dotimes (gp-0 8) + (dotimes (_color-idx 8) (format 0 " (new 'static 'mood-color") - (let ((v1-5 gp-0)) + (let ((color-idx _color-idx)) (cond - ((zero? v1-5) + ((zero? color-idx) (format 0 " ; sun rise~%") ) - ((= v1-5 1) + ((= color-idx 1) (format 0 " ; morning~%") ) - ((= v1-5 2) + ((= color-idx 2) (format 0 " ; noon~%") ) - ((= v1-5 3) + ((= color-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-5 4) + ((= color-idx 4) (format 0 " ; sunset~%") ) - ((= v1-5 5) + ((= color-idx 5) (format 0 " ; twilight~%") ) - ((= v1-5 6) + ((= color-idx 6) (format 0 " ; evening~%") ) - ((= v1-5 7) + ((= color-idx 7) (format 0 " ; green sun~%") ) ) @@ -178,18 +181,18 @@ (format 0 " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-0 lgt-color x) - (-> *overide-table* mood-color-table data gp-0 lgt-color y) - (-> *overide-table* mood-color-table data gp-0 lgt-color z) - (-> *overide-table* mood-color-table data gp-0 lgt-color w) + (-> *overide-table* mood-color-table data _color-idx lgt-color x) + (-> *overide-table* mood-color-table data _color-idx lgt-color y) + (-> *overide-table* mood-color-table data _color-idx lgt-color z) + (-> *overide-table* mood-color-table data _color-idx lgt-color w) ) (format 0 " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-0 amb-color x) - (-> *overide-table* mood-color-table data gp-0 amb-color y) - (-> *overide-table* mood-color-table data gp-0 amb-color z) - (-> *overide-table* mood-color-table data gp-0 amb-color w) + (-> *overide-table* mood-color-table data _color-idx amb-color x) + (-> *overide-table* mood-color-table data _color-idx amb-color y) + (-> *overide-table* mood-color-table data _color-idx amb-color z) + (-> *overide-table* mood-color-table data _color-idx amb-color w) ) (format 0 " )~%") ) @@ -199,32 +202,32 @@ (format 0 "(define *overide-mood-fog-table*~%") (format 0 " (new 'static 'mood-fog-table~%") (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") - (dotimes (gp-1 8) + (dotimes (_fog-idx 8) (format 0 " (new 'static 'mood-fog") - (let ((v1-33 gp-1)) + (let ((fog-idx _fog-idx)) (cond - ((zero? v1-33) + ((zero? fog-idx) (format 0 " ; sun rise~%") ) - ((= v1-33 1) + ((= fog-idx 1) (format 0 " ; morning~%") ) - ((= v1-33 2) + ((= fog-idx 2) (format 0 " ; noon~%") ) - ((= v1-33 3) + ((= fog-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-33 4) + ((= fog-idx 4) (format 0 " ; sunset~%") ) - ((= v1-33 5) + ((= fog-idx 5) (format 0 " ; twilight~%") ) - ((= v1-33 6) + ((= fog-idx 6) (format 0 " ; evening~%") ) - ((= v1-33 7) + ((= fog-idx 7) (format 0 " ; green sun~%") ) ) @@ -232,18 +235,18 @@ (format 0 " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-fog-table data gp-1 fog-color x) - (-> *overide-table* mood-fog-table data gp-1 fog-color y) - (-> *overide-table* mood-fog-table data gp-1 fog-color z) - (-> *overide-table* mood-fog-table data gp-1 fog-color w) + (-> *overide-table* mood-fog-table data _fog-idx fog-color x) + (-> *overide-table* mood-fog-table data _fog-idx fog-color y) + (-> *overide-table* mood-fog-table data _fog-idx fog-color z) + (-> *overide-table* mood-fog-table data _fog-idx fog-color w) ) (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (-> *overide-table* mood-fog-table data gp-1 fog-dists x) - (-> *overide-table* mood-fog-table data gp-1 fog-dists y) - (-> *overide-table* mood-fog-table data gp-1 fog-dists w) - (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") (format 0 " )~%") @@ -258,38 +261,46 @@ ;; WARN: Return type mismatch object vs none. (defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color -Apply said overrides to the [[*overide-table*]]" + Apply said overrides to the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256 ) - (dotimes (v1-1 8) - (let ((a1-3 (-> *overide-table* mood-color-table data v1-1)) + (dotimes (data-idx 8) + (let ((color-data (-> *overide-table* mood-color-table data data-idx)) (mood-colors (the-as (inline-array mood-color) - (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) v1-1) + (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) data-idx) ) ) ) - (let ((f1-2 (fmax (fmax (-> a1-3 lgt-color x) (-> a1-3 lgt-color y)) (-> a1-3 lgt-color z))) - (f0-4 + (let ((max-light-color + (fmax (fmax (-> color-data lgt-color x) (-> color-data lgt-color y)) (-> color-data lgt-color z)) + ) + (max-0th-light-color (fmax (fmax (-> mood-colors 0 lgt-color x) (-> mood-colors 0 lgt-color y)) (-> mood-colors 0 lgt-color z)) ) ) - (set! (-> a1-3 lgt-color x) (* (+ (-> a1-3 lgt-color x) (* (- f1-2 (-> a1-3 lgt-color x)) arg0)) arg1)) - (set! (-> a1-3 lgt-color y) (* (+ (-> a1-3 lgt-color y) (* (- f1-2 (-> a1-3 lgt-color y)) arg0)) arg1)) - (set! (-> a1-3 lgt-color z) (* (+ (-> a1-3 lgt-color z) (* (- f1-2 (-> a1-3 lgt-color z)) arg0)) arg1)) - (set! (-> a1-3 lgt-color w) 0.0) + (set! (-> color-data lgt-color x) + (* (+ (-> color-data lgt-color x) (* (- max-light-color (-> color-data lgt-color x)) arg0)) arg1) + ) + (set! (-> color-data lgt-color y) + (* (+ (-> color-data lgt-color y) (* (- max-light-color (-> color-data lgt-color y)) arg0)) arg1) + ) + (set! (-> color-data lgt-color z) + (* (+ (-> color-data lgt-color z) (* (- max-light-color (-> color-data lgt-color z)) arg0)) arg1) + ) + (set! (-> color-data lgt-color w) 0.0) (set! (-> mood-colors 0 lgt-color x) - (* (+ (-> mood-colors 0 lgt-color x) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color x) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) (set! (-> mood-colors 0 lgt-color y) - (* (+ (-> mood-colors 0 lgt-color y) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color y) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) (set! (-> mood-colors 0 lgt-color z) - (* (+ (-> mood-colors 0 lgt-color z) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color z) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) ) (set! (-> mood-colors 0 lgt-color w) 1.0) @@ -298,32 +309,32 @@ Apply said overrides to the [[*overide-table*]]" (format 0 "(define *overide-mood-color-table*~%") (format 0 " (new 'static 'mood-color-table~%") (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") - (dotimes (gp-1 8) + (dotimes (_color-idx 8) (format 0 " (new 'static 'mood-color") - (let ((v1-4 gp-1)) + (let ((color-idx _color-idx)) (cond - ((zero? v1-4) + ((zero? color-idx) (format 0 " ; sun rise~%") ) - ((= v1-4 1) + ((= color-idx 1) (format 0 " ; morning~%") ) - ((= v1-4 2) + ((= color-idx 2) (format 0 " ; noon~%") ) - ((= v1-4 3) + ((= color-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-4 4) + ((= color-idx 4) (format 0 " ; sunset~%") ) - ((= v1-4 5) + ((= color-idx 5) (format 0 " ; twilight~%") ) - ((= v1-4 6) + ((= color-idx 6) (format 0 " ; evening~%") ) - ((= v1-4 7) + ((= color-idx 7) (format 0 " ; green sun~%") ) ) @@ -331,18 +342,18 @@ Apply said overrides to the [[*overide-table*]]" (format 0 " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-1 lgt-color x) - (-> *overide-table* mood-color-table data gp-1 lgt-color y) - (-> *overide-table* mood-color-table data gp-1 lgt-color z) - (-> *overide-table* mood-color-table data gp-1 lgt-color w) + (-> *overide-table* mood-color-table data _color-idx lgt-color x) + (-> *overide-table* mood-color-table data _color-idx lgt-color y) + (-> *overide-table* mood-color-table data _color-idx lgt-color z) + (-> *overide-table* mood-color-table data _color-idx lgt-color w) ) (format 0 " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-1 amb-color x) - (-> *overide-table* mood-color-table data gp-1 amb-color y) - (-> *overide-table* mood-color-table data gp-1 amb-color z) - (-> *overide-table* mood-color-table data gp-1 amb-color w) + (-> *overide-table* mood-color-table data _color-idx amb-color x) + (-> *overide-table* mood-color-table data _color-idx amb-color y) + (-> *overide-table* mood-color-table data _color-idx amb-color z) + (-> *overide-table* mood-color-table data _color-idx amb-color w) ) (format 0 " )~%") ) @@ -355,47 +366,53 @@ Apply said overrides to the [[*overide-table*]]" ;; WARN: Return type mismatch object vs none. (defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color -Apply said overrides to the [[*overide-table*]]" + Apply said overrides to the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384) - (dotimes (v1-2 8) - (let ((a0-5 (-> *overide-table* mood-fog-table data v1-2))) - (let ((f0-2 (fmax (fmax (-> a0-5 fog-color x) (-> a0-5 fog-color y)) (-> a0-5 fog-color z)))) - (set! (-> a0-5 fog-color x) (* (+ (-> a0-5 fog-color x) (* (- f0-2 (-> a0-5 fog-color x)) arg1)) arg2)) - (set! (-> a0-5 fog-color y) (* (+ (-> a0-5 fog-color y) (* (- f0-2 (-> a0-5 fog-color y)) arg1)) arg2)) - (set! (-> a0-5 fog-color z) (* (+ (-> a0-5 fog-color z) (* (- f0-2 (-> a0-5 fog-color z)) arg1)) arg2)) + (dotimes (data-idx 8) + (let ((fog-data (-> *overide-table* mood-fog-table data data-idx))) + (let ((max-fog-val (fmax (fmax (-> fog-data fog-color x) (-> fog-data fog-color y)) (-> fog-data fog-color z)))) + (set! (-> fog-data fog-color x) + (* (+ (-> fog-data fog-color x) (* (- max-fog-val (-> fog-data fog-color x)) arg1)) arg2) + ) + (set! (-> fog-data fog-color y) + (* (+ (-> fog-data fog-color y) (* (- max-fog-val (-> fog-data fog-color y)) arg1)) arg2) + ) + (set! (-> fog-data fog-color z) + (* (+ (-> fog-data fog-color z) (* (- max-fog-val (-> fog-data fog-color z)) arg1)) arg2) + ) ) - (set! (-> a0-5 fog-color w) 1.0) + (set! (-> fog-data fog-color w) 1.0) ) ) (format 0 "(define *overide-mood-fog-table*~%") (format 0 " (new 'static 'mood-fog-table~%") (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") - (dotimes (gp-1 8) + (dotimes (_fog-idx 8) (format 0 " (new 'static 'mood-fog") - (let ((v1-5 gp-1)) + (let ((fog-idx _fog-idx)) (cond - ((zero? v1-5) + ((zero? fog-idx) (format 0 " ; sun rise~%") ) - ((= v1-5 1) + ((= fog-idx 1) (format 0 " ; morning~%") ) - ((= v1-5 2) + ((= fog-idx 2) (format 0 " ; noon~%") ) - ((= v1-5 3) + ((= fog-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-5 4) + ((= fog-idx 4) (format 0 " ; sunset~%") ) - ((= v1-5 5) + ((= fog-idx 5) (format 0 " ; twilight~%") ) - ((= v1-5 6) + ((= fog-idx 6) (format 0 " ; evening~%") ) - ((= v1-5 7) + ((= fog-idx 7) (format 0 " ; green sun~%") ) ) @@ -403,18 +420,18 @@ Apply said overrides to the [[*overide-table*]]" (format 0 " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-fog-table data gp-1 fog-color x) - (-> *overide-table* mood-fog-table data gp-1 fog-color y) - (-> *overide-table* mood-fog-table data gp-1 fog-color z) - (-> *overide-table* mood-fog-table data gp-1 fog-color w) + (-> *overide-table* mood-fog-table data _fog-idx fog-color x) + (-> *overide-table* mood-fog-table data _fog-idx fog-color y) + (-> *overide-table* mood-fog-table data _fog-idx fog-color z) + (-> *overide-table* mood-fog-table data _fog-idx fog-color w) ) (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists x)) - (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists y)) - (-> *overide-table* mood-fog-table data gp-1 fog-dists w) - (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") (format 0 " )~%") diff --git a/goal_src/jak2/engine/gfx/mood/mood.gc b/goal_src/jak2/engine/gfx/mood/mood.gc index a7d2a118bc..95c36b5c95 100644 --- a/goal_src/jak2/engine/gfx/mood/mood.gc +++ b/goal_src/jak2/engine/gfx/mood/mood.gc @@ -24,10 +24,10 @@ #f ) -(defun clear-mood-times ((arg0 mood-context)) +(defun clear-mood-times ((mood-ctx mood-context)) "Clear all of the mood times on the given context" - (dotimes (v1-0 8) - (set! (-> arg0 times v1-0 w) 0.0) + (dotimes (idx 8) + (set! (-> mood-ctx times idx w) 0.0) ) #f ) @@ -531,8 +531,8 @@ (set! (-> arg0 times arg1 w) f30-1) (when (not (paused?)) (if (< 0.75 f30-1) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50))) ) ) ) @@ -897,9 +897,9 @@ ;; WARN: Return type mismatch int vs sound-id. (defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound -- Plays the lightning sound if we are not loading and `lightning-id` is zero -- Stops the lightning sound first if `lightning-id` is non-zero -Returns the current value of `lightning-id`" + - Plays the lightning sound if we are not loading and `lightning-id` is zero + - Stops the lightning sound first if `lightning-id` is non-zero + Returns the current value of `lightning-id`" (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) (the-as sound-id (cond ((or (load-in-progress? *level*) (movie?)) @@ -1331,8 +1331,8 @@ Returns the current value of `lightning-id`" (defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog -If `*-speed` is 0.0, use the `*-target` args to set `current-interp` -See [[mood-weather]]" + If `*-speed` is 0.0, use the `*-target` args to set `current-interp` + See [[mood-weather]]" (set! (-> this target-interp cloud) cloud-target) (set! (-> this target-interp fog) fog-target) (set! (-> this speed-interp cloud) cloud-speed) @@ -1349,7 +1349,7 @@ See [[mood-weather]]" (defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog -See [[mood-range]]" + See [[mood-range]]" (set! (-> this range min-cloud) min-cloud) (set! (-> this range max-cloud) max-cloud) (set! (-> this range min-fog) min-fog) @@ -1360,7 +1360,7 @@ See [[mood-range]]" (defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values -See [[mood-weather]]" + See [[mood-weather]]" (set! (-> this time-until-random cloud) arg0) (set! (-> this time-until-random fog) arg1) 0 diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 5eebf20817..d76ad79010 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -15,6 +15,7 @@ ) (defmethod deactivate ((this time-of-day-proc)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this sun)) (kill-and-free-particles (-> this sun)) ) @@ -198,7 +199,7 @@ (-> self time-of-day) ) (('time-of-day-norm) - (* 0.041666668 (-> self time-of-day)) + (/ (-> self time-of-day) 24) ) (('hour) (-> self hours) @@ -305,10 +306,10 @@ (set! (-> *overide-mood-color-table* data v1-8 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-8) 1.0 1.0 1.0 1.0) ) @@ -366,7 +367,7 @@ ) (let* ((f0-23 (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z))) (f2-14 (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z))) - (f0-27 (fmin 0.85 (- 1.0 (/ (* 0.5 f2-14) (+ f0-23 f2-14))))) + (f0-27 (fmin 0.85 (- 1.0 (/ (/ f2-14 2) (+ f0-23 f2-14))))) (v0-1 (-> arg0 current-shadow-color)) ) (set! (-> v0-1 x) f0-27) @@ -631,8 +632,8 @@ (v1-1 (-> *time-of-day-context* current-fog)) (f1-0 (-> v1-1 fog-dists x)) (f2-0 (-> v1-1 fog-dists y)) - (f3-1 (* 0.003921569 (-> v1-1 fog-dists w))) - (f4-2 (* 0.003921569 (-> v1-1 fog-dists z))) + (f3-1 (/ (-> v1-1 fog-dists w) 255)) + (f4-2 (/ (-> v1-1 fog-dists z) 255)) ) (+ f4-2 (* (fmax 0.0 (fmin 1.0 (/ (- f0-0 f1-0) (- f2-0 f1-0)))) (- f3-1 f4-2))) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index a0f40a30a2..281c783801 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -19,7 +19,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) @@ -271,7 +271,7 @@ (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) - (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16) ) ) (set-vector! (-> arg0 index-table 0) 63 84 66 0) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 43b6271164..013c9463f8 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -45,7 +45,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) @@ -342,7 +342,7 @@ (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) - (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28) ) ) (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc index a50cd014d9..b6c44ba387 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc @@ -569,8 +569,8 @@ (defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) - (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) - (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950)) + (f1-3 (/ (-> arg1 sun 0 pos z) 9950)) (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) 1.0 (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) @@ -737,7 +737,7 @@ (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) - (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale))) (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) ) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean.gc b/goal_src/jak2/engine/gfx/ocean/ocean.gc index 62da36dfac..7b5f45ef3d 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean.gc @@ -10,8 +10,8 @@ ;; DECOMP BEGINS (defmethod set-corners! ((this ocean) (corner-x float) (corner-z float)) - (let* ((f2-0 (* 0.00008138021 corner-x)) - (f3-0 (* 0.00008138021 corner-z)) + (let* ((f2-0 (/ corner-x (meters 3))) + (f3-0 (/ corner-z (meters 3))) (f0-2 f2-0) (f0-4 (- f0-2 (the float (the int f0-2)))) (f1-6 f3-0) @@ -41,8 +41,8 @@ ((and (-> this heights) *ocean-map*) (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) (f28-0 (- (-> arg0 z) (-> this start-corner z))) - (v1-3 (the int (* 0.0000025431316 f30-0))) - (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-3 (the int (/ f30-0 (meters 96)))) + (a0-2 (the int (/ f28-0 (meters 96)))) (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond @@ -53,8 +53,8 @@ ) ) ((begin - (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) - (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3)) + (a3-4 (logand (the int (/ f28-0 (meters 24))) 3)) (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) @@ -67,14 +67,12 @@ ) ) (else - (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) - (ash 1 a0-14) - ) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) - (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + (f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24))))) ) (if (-> this ocean-near-translucent?) (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc index 19f648abfd..72843110cc 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc @@ -251,8 +251,8 @@ (set! (-> arg1 radius) f28-0) (let ((f24-0 (sin f26-0)) (f26-1 (cos f26-0)) - (f22-0 (sin (* 0.5 f30-0))) - (f0-5 (cos (* 0.5 f30-0))) + (f22-0 (sin (/ f30-0 2))) + (f0-5 (cos (/ f30-0 2))) (a1-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc index 1ed1cd06d9..0830a94dc9 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc @@ -77,13 +77,7 @@ across the screen. The resolution of the circle is defined by the number of "tur (let ((rot (* 65536.0 (/ (the float turn) (the float turns))))) (set-vector! (-> tbls entry entry-idx) (* (sin rot) cam-aspx) (* (cos rot) cam-aspy) 0.0 0.0) (let ((s3-1 (+ entry-idx 1))) - (set-vector! - (-> tbls entry s3-1) - (* 0.001953125 cam-aspx (sin rot)) - (* 0.001953125 cam-aspy (cos rot)) - 0.0 - 0.0 - ) + (set-vector! (-> tbls entry s3-1) (* (/ cam-aspx 512) (sin rot)) (* (/ cam-aspy 512) (cos rot)) 0.0 0.0) (set! entry-idx (+ s3-1 1)) ) ) @@ -92,7 +86,7 @@ across the screen. The resolution of the circle is defined by the number of "tur ) (set-vector! (-> tbls entry entry-idx) 0.0 cam-aspy 0.0 0.0) (let ((v1-20 (+ entry-idx 1))) - (set-vector! (-> tbls entry v1-20) 0.0 (* 0.001953125 cam-aspy) 0.0 0.0) + (set-vector! (-> tbls entry v1-20) 0.0 (/ cam-aspy 512) 0.0 0.0) (+ v1-20 1) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc index 6e7afd6d13..cdeb2581d8 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc @@ -539,7 +539,7 @@ 1.0 ) (else - (let* ((f1-1 (* 0.00024414062 a0-5)) + (let* ((f1-1 (/ a0-5 METER_LENGTH)) (f0-4 (- f1-1 (the float (the int f1-1)))) ) (let ((f1-3 (* 4096.0 (- f1-1 f0-4)))) diff --git a/goal_src/jak2/engine/physics/dynamics-h.gc b/goal_src/jak2/engine/physics/dynamics-h.gc index d6ce5bf629..3c164364be 100644 --- a/goal_src/jak2/engine/physics/dynamics-h.gc +++ b/goal_src/jak2/engine/physics/dynamics-h.gc @@ -30,7 +30,7 @@ ) (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) (defun time-to-ground ((arg0 float) (arg1 float) (arg2 float)) @@ -38,8 +38,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index a0451fdc6b..dace569663 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -48,8 +48,8 @@ ) ) -(defmethod relocate ((this rigid-body-control) (arg0 int)) - (&+! (-> this process) arg0) +(defmethod relocate ((this rigid-body-control) (offset int)) + (&+! (-> this process) offset) this ) @@ -64,7 +64,7 @@ ) (matrix-identity! (-> this inertial-tensor)) (matrix-identity! (-> this inv-inertial-tensor)) - (let ((f0-4 (* 0.083333336 f24-0))) + (let ((f0-4 (/ f24-0 12))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) @@ -1023,11 +1023,11 @@ (defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (allocate-and-init-cshape this) (process-drawable-from-entity! this arg0) (init-skel-and-rigid-body this) @@ -1410,7 +1410,7 @@ This commonly includes things such as: (f0-9 (/ 163840.0 (get-inv-mass a0-38))) ) (vector-reset! (-> this player-force)) - (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) + (set! (-> this player-force y) (* (/ f0-9 -10) f30-2)) ) ) ) diff --git a/goal_src/jak2/engine/physics/trajectory.gc b/goal_src/jak2/engine/physics/trajectory.gc index cce583c1df..c8c83ee817 100644 --- a/goal_src/jak2/engine/physics/trajectory.gc +++ b/goal_src/jak2/engine/physics/trajectory.gc @@ -9,7 +9,7 @@ (defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) + (+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity))) arg1 ) @@ -31,7 +31,7 @@ (vector-! (-> this initial-velocity) arg1 arg0) (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity)))) 0 (none) ) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index aa96a1e8ad..a709216240 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -234,6 +234,7 @@ ) (defmethod deactivate ((this scene-player)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) ((method-of-type process-drawable deactivate) this) @@ -241,23 +242,23 @@ ) ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate ((this scene-player) (arg0 int)) +(defmethod relocate ((this scene-player) (offset int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) - (set! (-> v1-0 relocating-offset) arg0) + (set! (-> v1-0 relocating-offset) offset) ) (let ((v1-2 (-> this scene-list))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> this scene-list) arg0) + (&+! (-> this scene-list) offset) ) ) - (the-as scene-player ((method-of-type process-drawable relocate) this arg0)) + (the-as scene-player ((method-of-type process-drawable relocate) this offset)) ) (defmethod scene-player-method-25 ((this scene-player) (arg0 float)) @@ -661,7 +662,7 @@ ) (let* ((v1-28 (-> s3-0 base)) (a2-23 - (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-8 (+ (the int (-> arg1 origin y)) 1841)) (a0-23 (+ a2-23 (-> arg0 width))) @@ -687,7 +688,7 @@ (&+! (-> s3-0 base) 112) (let* ((v1-32 (-> s3-0 base)) (a1-38 - (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-11 (+ (the int (-> arg1 origin y)) 1840)) (a0-30 (+ a1-38 (-> arg0 width))) @@ -1051,10 +1052,7 @@ (* 30.0 (seconds-per-frame)) (bucket-id screen-filter) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (set! (-> *setting-control* user-current bg-a) 0.0) (remove-setting! 'movie) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index eddaf653bd..2ef2122797 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -13,6 +13,7 @@ (defmethod kill-callback ((this engine-sound-pers) (arg0 connection-pers)) + "Called when a connection is removed." (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -40,8 +41,9 @@ (kmemclose) -(defun sound-name= ((arg0 sound-name) (arg1 sound-name)) - (and (= (the-as uint arg0) (the-as uint arg1)) (= (-> arg0 hi) (-> arg1 hi))) +(defun sound-name= ((a sound-name) (b sound-name)) + "Are two sound names the same?" + (and (= (the-as uint a) (the-as uint b)) (= (-> a hi) (-> b hi))) ) (deftype sound-iop-info (structure) @@ -75,6 +77,7 @@ (define *sound-iop-info* (new 'global 'sound-iop-info)) (defun str-is-playing? () + "Is any streaming audio playing?" (countdown (v1-0 4) (if (and (>= (the-as uint (-> *sound-iop-info* stream-id v1-0)) 0) (logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four)) @@ -86,6 +89,7 @@ ) (defun str-id-is-playing? ((arg0 int)) + "Is any streaming audio with the given ID playing?" (countdown (v1-0 4) (if (and (= arg0 (-> *sound-iop-info* stream-id v1-0)) (logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-one ststatus-six)) @@ -96,31 +100,35 @@ #f ) -(defun current-str-pos ((arg0 sound-id)) +(defun current-str-pos ((id sound-id)) + "Get the current stream position of the given sound ID, or -1 if it is not playing." (if (>= (-> *setting-control* user-current movie-skip-frame) 0.0) (return (the int (* 34.133335 (-> *setting-control* user-current movie-skip-frame)))) ) (dotimes (v1-5 4) - (if (= arg0 (-> *sound-iop-info* stream-id v1-5)) + (if (= id (-> *sound-iop-info* stream-id v1-5)) (return (the-as int (-> *sound-iop-info* stream-position v1-5))) ) ) -1 ) -(defun is-ramdisk-loaded? ((arg0 symbol)) +(defun is-ramdisk-loaded? ((name symbol)) + "Check if the ramdisk-name is set to this (unused)." (let ((gp-0 (-> *sound-iop-info* ramdisk-name)) - (s5-0 (symbol->string arg0)) + (s5-0 (symbol->string name)) ) (and (charp-prefix= (-> s5-0 data) gp-0) (= (-> gp-0 (length s5-0)) 46)) ) ) (defun is-cd-in? () + "Is the CD/DVD in the ps2?" (zero? (-> *sound-iop-info* nocd)) ) (defun new-sound-id () + "Allocate a new sound ID, used to identify a unique playback of a sound." (set! *current-sound-id* (+ *current-sound-id* 1)) (if (< (the-as int *current-sound-id*) #x10000) (set! *current-sound-id* (the-as sound-id #x10000)) @@ -129,6 +137,7 @@ ) (defun check-irx-version () + "Confirm OVERLORD version is correct and set up the sound-iop-info address so the OVERLORD can report back to the EE." (let ((gp-0 (the-as sound-rpc-get-irx-version (add-element *sound-loader-rpc*)))) (set! (-> gp-0 command) (sound-command get-irx-version)) (set! (-> gp-0 ee-addr) (&-> *sound-iop-info* frame)) @@ -145,22 +154,24 @@ 0 ) -(defun sound-bank-iop-store ((arg0 sound-name)) +(defun sound-bank-iop-store ((name sound-name)) + "Send a iop-store RPC to loader with the given name" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command iop-store)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-iop-free ((arg0 sound-name)) +(defun sound-bank-iop-free ((name sound-name)) + "Send a iop-free RPC to loader with the given name" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command iop-free)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 @@ -168,6 +179,7 @@ ) (defun sound-bank-load ((arg0 sound-name)) + "Send RPC to load a sound bank." (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank)) @@ -178,48 +190,53 @@ ) ) -(defun sound-bank-load-from-iop ((arg0 sound-name)) +(defun sound-bank-load-from-iop ((name sound-name)) + "Send load-bank-from-iop rpc to loader" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank-from-iop)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-load-from-ee ((arg0 sound-name) (arg1 pointer)) +(defun sound-bank-load-from-ee ((name sound-name) (addr pointer)) + "Send load-bank-from-ee rpc to loader" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank-from-ee)) - (set! (-> v1-1 bank-name) arg0) - (set! (-> v1-1 ee-addr) arg1) + (set! (-> v1-1 bank-name) name) + (set! (-> v1-1 ee-addr) addr) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-unload ((arg0 sound-name)) +(defun sound-bank-unload ((name sound-name)) + "Send unload-bank rpc to loader" (let ((v1-1 (the-as sound-rpc-unload-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command unload-bank)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) 0 ) -(defun sound-music-load ((arg0 sound-name)) +(defun sound-music-load ((name sound-name)) + "Send load-music rpc to loader" (let ((v1-1 (the-as sound-rpc-load-music (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-music)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) 0 ) (defun sound-music-unload () + "Send unload-music rpc to loader." (let ((v1-1 (the-as sound-rpc-unload-music (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command unload-music)) ) @@ -228,6 +245,7 @@ ) (defun set-language ((arg0 language-enum)) + "Send set-language rpc to loader. Note this is only for sound, no game text is changed." (kset-language arg0) (let ((v1-1 (the-as sound-rpc-set-language (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command set-language)) @@ -238,6 +256,7 @@ ) (defun sound-set-stereo-mode ((arg0 stereo-mode)) + "Send set-stereo-mode rpc to loader." (let ((v1-1 (the-as sound-rpc-set-stereo-mode (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command set-stereo-mode)) (set! (-> v1-1 mode) (the-as int arg0)) @@ -248,6 +267,7 @@ ) (defun list-sounds () + "Send list-sounds rpc to loader." (let ((v1-1 (the-as sound-rpc-list-sounds (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command list-sounds)) ) @@ -262,6 +282,7 @@ ) (defun sound-buffer-dump () + "Print out all sound-commands in the buffer." (let ((gp-0 (-> *sound-player-rpc* current elt-used)) (s5-0 (-> *sound-player-rpc* current elt-size)) ) @@ -299,6 +320,7 @@ (define *sound-player-enable* #t) (defun swap-sound-buffers ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Per-frame update of sound system - update loop-engine, update ear trans, send player RPC, check for missing/dirty CD." (run-pending-updates! *sound-loop-engine* (-> *display* base-clock frame-counter)) (cond ((check-busy *sound-player-rpc*) @@ -332,37 +354,42 @@ ) (defun get-sound-buffer-entry () + "Allocate a new entry in the player RPC queue, to be flushed on the next frame." (add-element *sound-player-rpc*) ) (defun free-last-sound-buffer-entry () + "Remove the last thing added with get-sound-buffer-entry." (decrement-elt-used *sound-player-rpc*) 0 (none) ) (defun sound-basic-cb ((arg0 int) (arg1 (pointer int32))) + "Unknown and unused callback." (set! (-> arg1 0) arg0) 0 (none) ) (defun sound-trans-convert ((arg0 vector3w) (arg1 vector)) + "Convert a GOAL translation (meters) to integer format for the IOP" (let ((v1-0 (if arg1 arg1 (ear-trans 0) ) ) ) - (set! (-> arg0 x) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> arg0 y) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> arg0 z) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> arg0 x) (the int (/ (-> v1-0 x) 16))) + (set! (-> arg0 y) (the int (/ (-> v1-0 y) 16))) + (set! (-> arg0 z) (the int (/ (-> v1-0 z) 16))) ) 0 ) -(defun sound-angle-convert ((arg0 float)) - (let* ((f0-3 (the float (sar (shl (the int arg0) 48) 48))) +(defun sound-angle-convert ((float-angle float)) + "Convert a GOAL angle to integer format for the iop" + (let* ((f0-3 (the float (sar (shl (the int float-angle) 48) 48))) (v0-0 (the int (* 0.005493164 f0-3))) ) (if (< v0-0 0) @@ -377,6 +404,7 @@ ;; WARN: Return type mismatch uint128 vs sound-name. (defun string->sound-name ((arg0 string)) + "Create a sound-name from a string" (let ((v1-0 (new 'stack-no-clear 'qword))) (set! (-> v1-0 quad) (the-as uint128 0)) (let ((a1-0 (the-as (pointer uint8) v1-0)) @@ -393,6 +421,7 @@ ) (defun sound-set-volume ((arg0 sound-group) (arg1 float)) + "Send set-master-volume rpc." (let ((v1-0 (the-as sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-master-volume)) (set! (-> v1-0 group) arg0) @@ -401,18 +430,20 @@ 0 ) -(defun sound-set-reverb ((arg0 int) (arg1 float) (arg2 float) (arg3 uint)) +(defun sound-set-reverb ((reverb int) (left float) (right float) (core uint)) + "Send set-reverb rpc" (let ((v1-0 (the-as sound-rpc-set-reverb (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-reverb)) - (set! (-> v1-0 core) arg3) - (set! (-> v1-0 reverb) arg0) - (set! (-> v1-0 left) (the-as uint (the int (* 32767.0 arg1)))) - (set! (-> v1-0 right) (the-as uint (the int (* 32767.0 arg2)))) + (set! (-> v1-0 core) core) + (set! (-> v1-0 reverb) reverb) + (set! (-> v1-0 left) (the-as uint (the int (* 32767.0 left)))) + (set! (-> v1-0 right) (the-as uint (the int (* 32767.0 right)))) ) 0 ) (defun sound-set-ear-trans ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Send set-ear-trans rpc" (let ((gp-0 (the-as sound-rpc-set-ear-trans (get-sound-buffer-entry)))) (set! (-> gp-0 command) (sound-command set-ear-trans)) (sound-trans-convert (the-as vector3w (-> gp-0 ear-trans0)) arg0) @@ -424,8 +455,9 @@ ) (defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object)) - "Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] -otherwise, an explicit [[vector]] can be provided" + "Send play rpc to play a sound! + Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] + otherwise, an explicit [[vector]] can be provided" (local-vars (sv-16 sound-group)) (set! sv-16 arg5) (let ((s4-0 arg6)) @@ -455,6 +487,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defbehavior sound-play-by-spec process-drawable ((arg0 sound-spec) (arg1 sound-id) (arg2 vector)) + "Send play rpc to play a sound!" (when *sound-player-enable* (let ((s5-0 (the-as sound-rpc-play (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command play)) @@ -483,37 +516,41 @@ otherwise, an explicit [[vector]] can be provided" arg1 ) -(defun sound-pause ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-pause ((id sound-id)) + "Send pause-sound rpc to pause by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-pause-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command pause-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) -(defun sound-stop ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-stop ((id sound-id)) + "Send stop-sound rpc to stop by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-stop-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command stop-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) -(defun sound-continue ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-continue ((id sound-id)) + "Send continue-sound rpc to continue by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-continue-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command continue-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) (defun sound-group-pause ((arg0 sound-group)) + "Send pause-group rpc" (let ((v1-0 (the-as sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command pause-group)) (set! (-> v1-0 group) arg0) @@ -522,6 +559,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-group-stop ((arg0 sound-group)) + "Send stop-group rpc" (let ((v1-0 (the-as sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command stop-group)) (set! (-> v1-0 group) arg0) @@ -530,6 +568,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-group-continue ((arg0 sound-group)) + "Send continue-group rpc" (let ((v1-0 (the-as sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command continue-group)) (set! (-> v1-0 group) arg0) @@ -537,33 +576,37 @@ otherwise, an explicit [[vector]] can be provided" 0 ) -(defun sound-set-flava ((arg0 uint) (arg1 uint)) +(defun sound-set-flava ((flava uint) (excitement uint)) + "Send set-flava rpc" (let ((v1-0 (the-as sound-rpc-set-flava (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-flava)) - (set! (-> v1-0 flava) arg0) - (set! (-> v1-0 excitement) arg1) + (set! (-> v1-0 flava) flava) + (set! (-> v1-0 excitement) excitement) ) 0 ) -(defun sound-set-midi-reg ((arg0 int) (arg1 int)) +(defun sound-set-midi-reg ((reg int) (val int)) + "Send set-midi-reg rpc" (let ((v1-0 (the-as sound-rpc-set-midi-reg (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-midi-reg)) - (set! (-> v1-0 reg) arg0) - (set! (-> v1-0 value) arg1) + (set! (-> v1-0 reg) reg) + (set! (-> v1-0 value) val) ) 0 ) -(defun sound-set-fps ((arg0 int)) +(defun sound-set-fps ((fps int)) + "Send set-fps rpc" (let ((v1-0 (the-as sound-rpc-set-fps (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-fps)) - (set! (-> v1-0 fps) (the-as uint arg0)) + (set! (-> v1-0 fps) (the-as uint fps)) ) 0 ) (defun sound-volume-off () + "Adjust settings to turn all sound volume off" (set-setting! 'music-volume 'abs 0.0 0) (set-setting! 'sfx-volume 'abs 0.0 0) (set-setting! 'ambient-volume 'abs 0.0 0) @@ -574,6 +617,7 @@ otherwise, an explicit [[vector]] can be provided" ;; WARN: Return type mismatch object vs ambient-sound. (defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector)) + "Set up ambient-sound. Can use an entity-actor (grabs from lump), sound-spec, or name as a string." (local-vars (sv-16 sound-spec) (sv-32 sound-name) @@ -679,6 +723,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update! ((this ambient-sound)) + "Per-frame update of ambient sound." (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) @@ -772,6 +817,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update-trans! ((this ambient-sound) (arg0 vector)) + "Change the trans of the sound." (with-pp (set! (-> this trans quad) (-> arg0 quad)) (when (nonzero? (-> this playing-id)) @@ -798,6 +844,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update-vol! ((this ambient-sound) (arg0 float)) + "Change the volume of the sound." (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -831,21 +878,23 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) - (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) + (set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH))) 0 (none) ) -(defmethod change-sound! ((this ambient-sound) (arg0 sound-name)) - (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) +(defmethod change-sound! ((this ambient-sound) (new-sound sound-name)) + "Change the sound being played." + (when (not (and (= (the-as uint (-> this name)) (the-as uint new-sound)) (= (-> new-sound hi) (-> this name hi)))) (stop! this) (set! (-> this playing-id) (new-sound-id)) - (set! (-> this name) arg0) + (set! (-> this name) new-sound) ) 0 ) (defun show-iop-info ((arg0 dma-buffer)) + "Display iop info on screen." (dotimes (s5-0 24) (draw-string-xy (if (zero? (-> *sound-iop-info* chinfo s5-0)) @@ -898,7 +947,8 @@ otherwise, an explicit [[vector]] can be provided" 0 ) -(defun show-iop-memory ((arg0 dma-buffer)) +(defun show-iop-memory ((dma dma-buffer)) + "Display iop memory stats on screen" (let ((s5-0 draw-string-xy)) (format (clear *temp-string*) @@ -906,7 +956,7 @@ otherwise, an explicit [[vector]] can be provided" (-> *sound-iop-info* freemem) (shr (-> *sound-iop-info* freemem) 10) ) - (s5-0 *temp-string* arg0 32 96 (font-color default) (font-flags shadow)) + (s5-0 *temp-string* dma 32 96 (font-color default) (font-flags shadow)) ) (let ((s5-1 draw-string-xy)) (format @@ -915,12 +965,13 @@ otherwise, an explicit [[vector]] can be provided" (-> *sound-iop-info* freemem2) (shr (-> *sound-iop-info* freemem2) 10) ) - (s5-1 *temp-string* arg0 32 64 (font-color default) (font-flags shadow)) + (s5-1 *temp-string* dma 32 64 (font-color default) (font-flags shadow)) ) 0 ) (defun ear-trans ((arg0 int)) + "Get the current location of the ear. Use 1 for the settings ear-handle, or 0 for the camera." (cond ((or (movie?) *external-cam-mode*) (math-camera-pos) @@ -935,6 +986,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun-debug make-sqrt-table () + "Generate integer square-root table used in the IOP." (format #t "static int sqrt_table[256] =~%{~%") (dotimes (gp-0 256) (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) @@ -968,11 +1020,12 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defun loader-test-command ((arg0 sound-command) (arg1 uint)) +(defun loader-test-command ((cmd sound-command) (param uint)) + "Send a command to loader by ID." (let ((v1-1 (the-as sound-rpc-test-cmd (add-element *sound-loader-rpc*)))) - (set! (-> v1-1 command) arg0) + (set! (-> v1-1 command) cmd) (set! (-> v1-1 ee-addr) (the-as pointer 0)) - (set! (-> v1-1 param0) arg1) + (set! (-> v1-1 param0) param) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) (sync *sound-loader-rpc* #f) @@ -980,12 +1033,13 @@ otherwise, an explicit [[vector]] can be provided" (none) ) -(defun doppler-pitch-shift ((arg0 vector) (arg1 vector)) +(defun doppler-pitch-shift ((sound-pos vector) (sound-vel vector)) + "Compute pitch shift for the doppler effect. This is done assuming the listener is *target* and has *target*'s velocity." (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (vector-! (-> gp-0 0) (target-pos 0) arg0) + (vector-! (-> gp-0 0) (target-pos 0) sound-pos) (if *target* - (vector-! (-> gp-0 1) arg1 (-> *target* control transv)) - (set! (-> gp-0 1 quad) (-> arg1 quad)) + (vector-! (-> gp-0 1) sound-vel (-> *target* control transv)) + (set! (-> gp-0 1 quad) (-> sound-vel quad)) ) (vector-normalize! (-> gp-0 0) 1.0) (let ((f0-1 (/ 1228800.0 (fmax 0.1 (- 1228800.0 (vector-dot (-> gp-0 0) (-> gp-0 1))))))) @@ -995,6 +1049,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-bank-reload () + "Start a background process to unload all sound banks, then load them again." (process-spawn-function process (lambda () @@ -1008,10 +1063,7 @@ otherwise, an explicit [[vector]] can be provided" (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 2)) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 86c17d80dc..fa5fcec98f 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -66,8 +66,8 @@ ) ) (set! (-> self board turn-anim-targ) (+ (lerp-scale - (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 2) + (/ (-> *TARGET_BOARD-bank* turn-frames) -2) f26-0 -5461.3335 5461.3335 @@ -80,8 +80,8 @@ 32768.0 ) (lerp-scale - (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 5) + (/ (-> *TARGET_BOARD-bank* turn-frames) -5) (-> self board turn-anim-mag) 1.0 -1.0 @@ -89,7 +89,7 @@ ) ) (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) - (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ)))) (>= (current-time) (-> self control turn-lockout-end-time)) ) ) @@ -2187,7 +2187,7 @@ (else (let ((f30-1 (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) - (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2)) ) ) (f0-23 @@ -2973,7 +2973,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index d969759d7c..5edaf54d2e 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -166,7 +166,7 @@ (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) (set! (-> arg0 seek0) (lerp-scale - (* 0.1 (-> arg0 seek0)) + (/ (-> arg0 seek0) 10) (-> arg0 seek0) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -175,7 +175,7 @@ ) (set! (-> arg0 seek90) (lerp-scale - (* 0.1 (-> arg0 seek90)) + (/ (-> arg0 seek90) 10) (-> arg0 seek90) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -191,8 +191,8 @@ (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) (set-time! (-> self control last-attack-end-time)) (set-time! (-> self board spin-ground-time)) - (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) - (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 seek0) (/ (-> arg0 seek0) 10)) + (set! (-> arg0 seek90) (/ (-> arg0 seek90) 10)) (set! (-> arg0 vel-turn) 131072.0) (set! (-> arg0 turnv) 91022.22) ) @@ -1749,7 +1749,7 @@ (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) + (or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -2065,7 +2065,7 @@ (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) (set! (-> s2-0 move-dist quad) (-> arg1 quad)) (let ((a0-3 s2-0)) - (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) (set! (-> a0-3 ignore-process0) (-> arg0 process)) (set! (-> a0-3 ignore-process1) #f) @@ -2466,7 +2466,7 @@ (let* ((f30-0 (-> self board ride-speed)) (f0-4 (lerp-scale (-> self control current-surface fric) - (* 0.2 (-> self control current-surface fric)) + (/ (-> self control current-surface fric) 5) f30-0 0.0 (-> self control current-surface transv-max) diff --git a/goal_src/jak2/engine/target/collide-reaction-target.gc b/goal_src/jak2/engine/target/collide-reaction-target.gc index e5b31465a3..61f3a50b39 100644 --- a/goal_src/jak2/engine/target/collide-reaction-target.gc +++ b/goal_src/jak2/engine/target/collide-reaction-target.gc @@ -151,7 +151,7 @@ ) (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4)) ) (>= (vector-dot tangent contact-normal) -0.000001) ) diff --git a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc index fa3c2e4efb..ad1b0e2ece 100644 --- a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc @@ -103,7 +103,7 @@ (vector-normalize! s5-1 1.0) (launch-particles (-> *part-id-table* 224) gp-0) (let ((s3-0 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 226 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-0 s5-1 *up-vector*) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index ac40e8a1ab..9ab02ce1ac 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -635,7 +635,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) @@ -3304,6 +3304,7 @@ ) (defmethod deactivate ((this target)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) (if (nonzero? (-> this darkjak)) (sound-stop (-> this darkjak tone)) diff --git a/goal_src/jak2/engine/target/mech/mech-part.gc b/goal_src/jak2/engine/target/mech/mech-part.gc index c8bd36950c..8c69c388d2 100644 --- a/goal_src/jak2/engine/target/mech/mech-part.gc +++ b/goal_src/jak2/engine/target/mech/mech-part.gc @@ -153,7 +153,7 @@ (quaternion-rotate-local-x! s1-0 s1-0 32768.0) (let ((a0-3 s0-0)) (let ((v1-10 arg1)) - (let ((a1-4 (* 0.5 arg4))) + (let ((a1-4 (/ arg4 2))) (.mov vf7 a1-4) ) (.lvf vf5 (&-> arg2 quad)) diff --git a/goal_src/jak2/engine/target/mech/mech-states.gc b/goal_src/jak2/engine/target/mech/mech-states.gc index 58119ea312..1ecab42cab 100644 --- a/goal_src/jak2/engine/target/mech/mech-states.gc +++ b/goal_src/jak2/engine/target/mech/mech-states.gc @@ -776,7 +776,7 @@ (else (seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (seconds-per-frame))) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) ) ) ) @@ -1002,7 +1002,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1137,7 +1138,9 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))) + (suspend-for (seconds 0.8) + (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) + ) (remove-setting! 'mode-name) ) (else @@ -1257,7 +1260,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1281,7 +1285,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (+ (the-as uint s5-0) (* s4-0 16))) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> (the-as sphere (&-> s5-0 x)) quad) (-> self control collision-spheres 2 prim-core world-sphere quad) ) @@ -2106,7 +2110,7 @@ (* 491520.0 (seconds-per-frame)) ) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) (let ((v1-120 (ja-group))) (if (and v1-120 (or (= v1-120 jakb-mech-push-ja) (= v1-120 jakb-mech-pull-ja))) (ja :num! (loop! f26-1)) diff --git a/goal_src/jak2/engine/target/surface-h.gc b/goal_src/jak2/engine/target/surface-h.gc index cc51e034c0..c45d9f6acf 100644 --- a/goal_src/jak2/engine/target/surface-h.gc +++ b/goal_src/jak2/engine/target/surface-h.gc @@ -67,6 +67,9 @@ ;; DECOMP BEGINS (deftype surface (basic) + "Definition of a bunch of parameters for different types of surfaces. +Parameters include values such as max speed, friction, callback functions that run +on impact, during touch, on exit, etc." ((name symbol) (turnv float) (turnvv float) @@ -111,17 +114,17 @@ (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/goal_src/jak2/engine/target/target-anim.gc b/goal_src/jak2/engine/target/target-anim.gc index dc37275a28..415289f71e 100644 --- a/goal_src/jak2/engine/target/target-anim.gc +++ b/goal_src/jak2/engine/target/target-anim.gc @@ -662,7 +662,7 @@ ) ((lambda :behavior target () - (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5)))))) (cond ((and (rand-vu-percent? 0.3) (< 20480.0 (-> self control ctrl-xz-vel))) (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) @@ -1020,10 +1020,10 @@ ) ) (let ((f0-37 (fabs (- f20-0 f30-0)))) - (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4))))) ) (let ((f0-42 (fabs (- f22-1 f28-0)))) - (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4))))) ) ) (set! (-> self control unknown-float-n12iuh3n1) f30-0) @@ -1556,7 +1556,7 @@ (let ((f0-11 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/goal_src/jak2/engine/target/target-carry.gc b/goal_src/jak2/engine/target/target-carry.gc index b8e08d1116..d6605e2c68 100644 --- a/goal_src/jak2/engine/target/target-carry.gc +++ b/goal_src/jak2/engine/target/target-carry.gc @@ -82,7 +82,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-0 0.0 1.0)) (let ((v1-17 gp-0)) diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 2c4de6d545..d4c95bb1b7 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -599,7 +599,7 @@ (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () - (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (set! (-> self control bend-target) (/ (-> self control bend-target) 2)) (if (logtest? (water-flags touch-water) (-> self water flags)) (sound-play "swim-stroke") ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index 73756f24a2..b8ca552f55 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -310,7 +310,8 @@ ) ) ) - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) ) ((logtest? (-> arg0 flags) (continue-flags title)) (go target-title #t) @@ -333,7 +334,8 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) (let ((s5-8 (new 'static 'vector)) (a2-26 (find-nearest-entity (-> arg0 trans) warp-gate)) ) @@ -362,7 +364,8 @@ (go target-grab 'stance) ) (else - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) ) ) (let* ((a0-122 *game-info*) @@ -981,7 +984,7 @@ (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) (if (< (- (-> self fact health) (-> sv-32 damage)) 1.0) (set! (-> sv-32 damage) (+ -1.0 (-> self fact health))) ) @@ -1013,7 +1016,8 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) gp-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1628,7 +1632,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (b! #t cfg-131 :delay (nop!)) (label cfg-79) (b! (not (or (= v1-63 'grenade) (= v1-63 'big-explosion) (= v1-63 'explode))) cfg-122 :delay (empty-form)) @@ -1739,7 +1744,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (b! #t cfg-131 :delay (nop!)) (label cfg-122) @@ -1788,7 +1794,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) (label cfg-131) @@ -1804,7 +1811,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 1.2)) + (suspend-for (seconds 1.2) + ) ) ((= v1-50 'endlessfall) ((lambda :behavior target @@ -1842,8 +1850,7 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for - (seconds 0.8) + (suspend-for (seconds 0.8) (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) (set! v1-24 'target-hit-ground-hard) (goto cfg-17) @@ -1886,7 +1893,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (remove-setting! 'mode-name) (none) @@ -1975,7 +1983,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ((= v1-50 'centipede) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index 071159e24f..f42547f390 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -1637,7 +1637,7 @@ (dotimes (s4-1 1) ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) ) - (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-212 gp-3)) @@ -1726,7 +1726,7 @@ (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) ) - (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + (seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5))) ) ) ) diff --git a/goal_src/jak2/engine/target/target-swim.gc b/goal_src/jak2/engine/target/target-swim.gc index 71eb0014ad..8b21f4614f 100644 --- a/goal_src/jak2/engine/target/target-swim.gc +++ b/goal_src/jak2/engine/target/target-swim.gc @@ -181,10 +181,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) (let ((f1-4 (fabs (- f0-10 f28-0)))) - (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f26-0)))) - (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index bacc5476fb..46f31e8c58 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -813,7 +813,7 @@ (f2-0 f1-2) ) (if (< f0-2 0.0) - (set! f0-2 (* 0.5 f0-2)) + (set! f0-2 (/ f0-2 2)) ) (vector+! (-> arg1 vector) @@ -1087,11 +1087,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak2/engine/target/target-turret-shot.gc b/goal_src/jak2/engine/target/target-turret-shot.gc index 68da24d5a4..420c0687c4 100644 --- a/goal_src/jak2/engine/target/target-turret-shot.gc +++ b/goal_src/jak2/engine/target/target-turret-shot.gc @@ -271,7 +271,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 923 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 923 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index ed6a94541c..c94c13d82e 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -384,7 +384,7 @@ ) ) (set! (-> this sprites 28 color w) - (the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current)))) + (the int (* (/ (-> this fade-interp) 256) (the float (-> this values 2 current)))) ) (set-as-offset-from! (-> this sprites 28) diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index 3f4836a711..8b9225a4d5 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -1080,7 +1080,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -1720,10 +1720,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 arg2))) ) (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) - (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5))) ) (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) - (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5))) ) ) (cond @@ -1897,8 +1897,8 @@ (cond ((and (< 0.0 f0-4) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) - (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) - (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) + (f0-5 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-4)) + (f0-8 (/ (* (/ f0-5 2) f0-5) (-> v1-0 dynam gravity-length))) ) (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-8) ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 3b38f56391..5acb706a2b 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -494,11 +494,11 @@ (delete-back-vel) (let* ((f0-4 arg5) (f1-2 0.0) - (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (f2-2 (+ (/ (-> self control dynam gravity-length) 600) (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (f0-5 (* f0-4 (fmax f1-2 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length))))) (s3-1 (+ arg0 f0-5)) ) (let ((s2-1 (+ arg1 f0-5))) @@ -626,7 +626,7 @@ (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant)) ) - (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) + (set! (-> v1-62 y) (/ (-> v1-62 y) 2)) ) (set! v0-1 (-> self control anim-collide-offset-local)) (set! (-> v0-1 quad) (-> v1-62 quad)) @@ -2645,7 +2645,7 @@ ) (else (let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-7 (* 0.5 f1-5 (seconds-per-frame) f0-2)) + (f0-7 (* (/ f1-5 2) (seconds-per-frame) f0-2)) ) (let ((v1-22 (ja-group))) (if (and v1-22 diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index 13f2b540ac..95b3f63705 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -50,7 +50,10 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05))) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) + ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) (until (ja-done? 0) @@ -649,7 +652,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) @@ -1196,7 +1199,9 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (suspend-for s5-0 (gp-0)) + (suspend-for s5-0 + (gp-0) + ) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) (cond @@ -1234,7 +1239,9 @@ (ja :num! (seek! max f30-0)) ) (let ((s5-2 (rand-vu-int-range 60 300))) - (suspend-for s5-2 (gp-0)) + (suspend-for s5-2 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) (until (ja-done? 0) @@ -1251,7 +1258,9 @@ (ja :num! (seek! 0.0 f30-0)) ) (let ((s5-3 (rand-vu-int-range 60 300))) - (suspend-for s5-3 (gp-0)) + (suspend-for s5-3 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak2/engine/ui/hud.gc b/goal_src/jak2/engine/ui/hud.gc index 4bcd99e92d..958e1e7e2d 100644 --- a/goal_src/jak2/engine/ui/hud.gc +++ b/goal_src/jak2/engine/ui/hud.gc @@ -924,7 +924,7 @@ :code (behavior () (until #f (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) - (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10)) ) (if (>= 0.0 (-> self offset)) (go hud-in) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 1c8b2ea943..42adbd42b2 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -1134,6 +1134,10 @@ (defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) + "Run updates if they scheduled. If something is found that has no pending update, kill it. + Note that we won't kill things on this call if they fail to update their `update-time`. + They will survive until the next call to `run-pending-updates`! + (or you can modify their `update-time` before that to prevent them from being killed.)" (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) (s3-0 (-> this alive-list)) ) @@ -1242,6 +1246,7 @@ ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. (defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) + "Called when a connection is removed." (if (not arg0) (return #f) ) @@ -1346,7 +1351,7 @@ (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2)) ) (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) @@ -1927,23 +1932,23 @@ (set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) ) (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) - (set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x))) - (set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z))) + (set! (-> s2-0 x) (/ (-> s2-0 x) (meters 1024))) + (set! (-> s2-0 z) (/ (-> s2-0 z) (meters 1024))) (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 0 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 0 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 1 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 1 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 2 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 2 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 3 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 3 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) diff --git a/goal_src/jak2/engine/ui/text.gc b/goal_src/jak2/engine/ui/text.gc index 53f4fe7bec..da6ae40df3 100644 --- a/goal_src/jak2/engine/ui/text.gc +++ b/goal_src/jak2/engine/ui/text.gc @@ -32,7 +32,7 @@ (kmemclose) -(defmethod relocate ((this game-text-info) (arg0 int)) +(defmethod relocate ((this game-text-info) (offset int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) @@ -52,21 +52,21 @@ ) -(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) - (set! (-> arg0 length) (max 84 (-> arg0 length))) - (set! (-> arg0 data 83 name) "string") - (+! (-> arg0 data 83 count) 1) +(defmethod mem-usage ((this game-text-info) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 84 (-> usage length))) + (set! (-> usage data 83 name) "string") + (+! (-> usage data 83 count) 1) (let ((v1-6 (asize-of this))) - (+! (-> arg0 data 83 used) v1-6) - (+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15))) + (+! (-> usage data 83 used) v1-6) + (+! (-> usage data 83 total) (logand -16 (+ v1-6 15))) ) (dotimes (s4-0 (-> this length)) - (set! (-> arg0 length) (max 84 (-> arg0 length))) - (set! (-> arg0 data 83 name) "string") - (+! (-> arg0 data 83 count) 1) + (set! (-> usage length) (max 84 (-> usage length))) + (set! (-> usage data 83 name) "string") + (+! (-> usage data 83 count) 1) (let ((v1-18 (asize-of (-> this data s4-0 text)))) - (+! (-> arg0 data 83 used) v1-18) - (+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15))) + (+! (-> usage data 83 used) v1-18) + (+! (-> usage data 83 total) (logand -16 (+ v1-18 15))) ) ) this @@ -464,7 +464,7 @@ in a single text group and file." ) (set! sv-64 0) (if (logtest? (-> arg1 flags) (font-flags middle)) - (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + (+! (-> arg1 origin x) (/ (-> arg1 width) 2)) ) (set! sv-72 (-> sv-32 0)) (set! sv-80 0) diff --git a/goal_src/jak2/engine/util/smush-control-h.gc b/goal_src/jak2/engine/util/smush-control-h.gc index 05fea6fb5c..205be0c514 100644 --- a/goal_src/jak2/engine/util/smush-control-h.gc +++ b/goal_src/jak2/engine/util/smush-control-h.gc @@ -8,6 +8,7 @@ ;; DECOMP BEGINS (deftype smush-control (structure) + "This holds information about the current state of an object's smush." ((start-time time-frame) (period float) (duration float) @@ -45,23 +46,23 @@ (defmethod update! ((this smush-control)) (cond ((!= (-> this amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) - (f0-2 (-> this period)) - (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + (let* ((elapsed-time (the float (- (current-time) (-> this start-time)))) + (period (-> this period)) + (f28-0 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period))) ) - (when (>= (- f30-0 (-> this ticks)) (-> this period)) + (when (>= (- elapsed-time (-> this ticks)) (-> this period)) (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) (set! (-> this period) (* (-> this period) (-> this damp-period))) - (set! (-> this ticks) f30-0) + (set! (-> this ticks) elapsed-time) (if (< (-> this damp-period) 0.0) (set-zero! this) ) ) - (if (>= f30-0 (-> this duration)) + (if (>= elapsed-time (-> this duration)) (set-zero! this) ) (* (sin (/ (* 65536.0 f28-0) (-> this period))) - (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) + (* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration))) ) ) ) @@ -74,12 +75,12 @@ (defmethod get-no-update ((this smush-control)) (cond ((!= (-> this amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) - (f0-2 (-> this period)) - (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + (let* ((elapsed-time (the float (- (current-time) (-> this start-time)))) + (period (-> this period)) + (f0-4 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period))) ) (* (sin (/ (* 65536.0 f0-4) (-> this period))) - (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) + (* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration))) ) ) ) @@ -96,15 +97,22 @@ this ) -(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) - (set! (-> this amp) arg0) - (set! (-> this period) (the float arg1)) - (set! (-> this duration) (the float arg2)) - (set! (-> this damp-amp) arg3) - (set! (-> this damp-period) arg4) +(defmethod activate! ((this smush-control) + (amplitude float) + (period int) + (duration int) + (damp-amplitude float) + (damp-period float) + (clock clock) + ) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) + (set! (-> this amp) amplitude) + (set! (-> this period) (the float period)) + (set! (-> this duration) (the float duration)) + (set! (-> this damp-amp) damp-amplitude) + (set! (-> this damp-period) damp-period) (set! (-> this ticks) 0.0) - (set! (-> this start-time) (-> arg5 frame-counter)) + (set! (-> this start-time) (-> clock frame-counter)) ) this ) diff --git a/goal_src/jak2/engine/util/sync-info.gc b/goal_src/jak2/engine/util/sync-info.gc index 0aa3e3d618..25acfcc1bc 100644 --- a/goal_src/jak2/engine/util/sync-info.gc +++ b/goal_src/jak2/engine/util/sync-info.gc @@ -425,7 +425,7 @@ (defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -525,8 +525,8 @@ (defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index f1b0e376c0..60cf98367c 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -252,7 +252,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) @@ -271,7 +271,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) @@ -557,21 +557,25 @@ ) ) :code (behavior () - (suspend-for (the int (-> self cycle-offset))) + (suspend-for (the int (-> self cycle-offset)) + ) (until #f - (suspend-for (the int (-> self cycle-time))) + (suspend-for (the int (-> self cycle-time)) + ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) - (suspend-for (seconds 0.75) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush))))) + (suspend-for (seconds 0.75) + (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) + ) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (sound-play "rot-pipe-turn" :position (-> self root trans)) (let* ((f0-7 2.0) (f30-1 (* 16384.0 f0-7)) ) - (suspend-for - (seconds 0.5) + (suspend-for (seconds 0.5) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) diff --git a/goal_src/jak2/levels/castle/boss/casboss-texture.gc b/goal_src/jak2/levels/castle/boss/casboss-texture.gc index ae091cba51..82d664108e 100644 --- a/goal_src/jak2/levels/castle/boss/casboss-texture.gc +++ b/goal_src/jak2/levels/castle/boss/casboss-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index f4606c8bae..9168115e0a 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -1024,7 +1024,7 @@ (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) ) - (+ 1.0 (* 0.2 f0-0)) + (+ 1.0 (/ f0-0 5)) (set! (-> this delta-wiggle-angle) (* 182.04445 f1-1)) (set! (-> this wiggle-factor) (* 2.0 f2-4)) ) diff --git a/goal_src/jak2/levels/castle/castle-texture.gc b/goal_src/jak2/levels/castle/castle-texture.gc index c90a97f96f..07ac5d2d6e 100644 --- a/goal_src/jak2/levels/castle/castle-texture.gc +++ b/goal_src/jak2/levels/castle/castle-texture.gc @@ -737,7 +737,7 @@ (set! (-> a1-4 data 0 end-time) f0-3) (set! (-> a1-4 data 1 end-time) f0-3) ) - (set! f0-3 (* 0.5 f0-3)) + (set! f0-3 (/ f0-3 2)) ) ) #f diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 2fa28e3d5e..c32b3a89fb 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -467,10 +467,10 @@ (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.9 1.1))) (until #f - (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (/ f30-0 10)) :frame-num 9.0) (until (ja-done? 0) (suspend) - (ja :num! (seek! 10.0 (* 0.1 f30-0))) + (ja :num! (seek! 10.0 (/ f30-0 10))) ) ) ) @@ -1107,7 +1107,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 80040c432b..1386dd1a36 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -1000,7 +1000,7 @@ (set! (-> t0-0 z) 0.0) (set! (-> t0-0 w) 1.0) (let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0)))) - (set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed)))) + (set! (-> s1-0 delta-y) (* (/ (-> v0-5 y) 20) (vector-length (-> s1-0 speed)))) ) ) ) @@ -2477,7 +2477,7 @@ ) (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) - (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (+! f30-0 (/ (-> v1-3 main-y) 4)) (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) diff --git a/goal_src/jak2/levels/city/common/nav-graph.gc b/goal_src/jak2/levels/city/common/nav-graph.gc index 4a1030f733..c01cc088fd 100644 --- a/goal_src/jak2/levels/city/common/nav-graph.gc +++ b/goal_src/jak2/levels/city/common/nav-graph.gc @@ -14,13 +14,13 @@ ) (defmethod set-speed-limit ((this nav-branch) (arg0 float)) - (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) (defmethod set-width ((this nav-branch) (arg0 float)) - (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256))))))) 0 (none) ) @@ -307,7 +307,7 @@ ) (defmethod set-radius ((this nav-node) (arg0 float)) - (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) @@ -1097,7 +1097,7 @@ (defmethod patch-nodes ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap -and patched at runtime after loading." + and patched at runtime after loading." (when (not (-> this patched)) (set! (-> this patched) #t) (let ((s5-0 0)) diff --git a/goal_src/jak2/levels/city/common/trail.gc b/goal_src/jak2/levels/city/common/trail.gc index 51d3066e09..bea6207c88 100644 --- a/goal_src/jak2/levels/city/common/trail.gc +++ b/goal_src/jak2/levels/city/common/trail.gc @@ -492,7 +492,7 @@ ) 0 (let* ((f0-0 (-> v1-0 cell-width)) - (f1-1 (* 0.5 f0-0)) + (f1-1 (/ (the float f0-0) 2)) ) (let ((f3-0 (- (-> arg0 x) f1-1)) (f2-2 (- (-> arg0 z) f1-1)) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index 1e842bb85a..7f3d197253 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -498,11 +498,11 @@ ) (vector+! (-> s1-0 trans) s4-0 s3-0) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) - (+! (-> s1-0 trans y) (* 0.5 arg1)) + (+! (-> s1-0 trans y) (/ arg1 2)) (vector-! (the-as vector (-> s2-2 vector)) s3-0 s4-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s2-2 vector)) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-2 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1)) @@ -512,7 +512,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans)))) (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) - (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v0-8 z) 0.0) (let ((f0-20 0.5) (f1-7 (* f30-1 f30-1)) @@ -663,7 +663,7 @@ 0.0 0.0 0.0 - (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH))) (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) @@ -1825,7 +1825,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s0-0 quad) vf6) (let ((f30-0 (vector-vector-xz-distance s4-0 s0-0))) - (let ((f0-2 (* 0.0000012207031 f30-0)) + (let ((f0-2 (/ f30-0 (meters 200))) (a0-7 s4-0) ) (let ((v1-10 s4-0)) @@ -1899,7 +1899,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'quaternion))) - (let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0)))) + (let ((f0-42 (/ 45511.11 (/ f30-0 METER_LENGTH)))) (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42))) ) (quaternion*! diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index 17379c736d..6f9dfb3a1a 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -1033,8 +1033,8 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12)) ) 0 (none) @@ -1375,9 +1375,9 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y))) - (set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120)) + (set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120)) ) 0 (none) diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index 0077572206..d843707f14 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -168,11 +168,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (format #t "~A initialising~%" (-> this name)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -200,9 +200,9 @@ This commonly includes things such as: (format 0 "trans ~F ~F ~F~%" - (* 0.00024414062 (-> v1-10 trans x)) - (* 0.00024414062 (-> v1-10 trans y)) - (* 0.00024414062 (-> v1-10 trans z)) + (/ (-> v1-10 trans x) METER_LENGTH) + (/ (-> v1-10 trans y) METER_LENGTH) + (/ (-> v1-10 trans z) METER_LENGTH) ) ) (set! (-> this ent) arg0) @@ -224,6 +224,7 @@ This commonly includes things such as: ) (defmethod run-logic? ((this ctypal-baron-statue-broken)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -235,11 +236,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/city/slums/kor/kid3-course.gc b/goal_src/jak2/levels/city/slums/kor/kid3-course.gc index 4cd0614027..d74a068964 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid3-course.gc @@ -99,7 +99,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/goal_src/jak2/levels/city/slums/kor/kor3-course.gc b/goal_src/jak2/levels/city/slums/kor/kor3-course.gc index 6152fc157d..e6162c111b 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor3-course.gc @@ -99,7 +99,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc index bc02d1dd9f..10965c66cc 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc @@ -435,7 +435,7 @@ (if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) ) (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc index 86719d594a..fd010b4f2a 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc @@ -97,8 +97,8 @@ ;; WARN: Return type mismatch int vs enemy-aware. (defmethod update-target-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! -@TODO - flesh out docs -@returns the value that sets `aware`" + @TODO - flesh out docs + @returns the value that sets `aware`" (when arg1 (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) @@ -239,7 +239,7 @@ (defmethod general-event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (let ((v1-1 #f)) @@ -357,9 +357,9 @@ (defmethod common-post ((this citizen)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (when (< (-> this next-time-look-at) (current-time)) (when (nonzero? (-> this neck)) (let ((a0-4 (handle->process (-> this focus handle)))) @@ -587,7 +587,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) @@ -645,11 +645,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index d050d067fc..9f65dbbf8b 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -254,7 +254,7 @@ (defmethod general-event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) #f @@ -950,7 +950,7 @@ ) (if (and (-> self allow-dive) (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) - (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2)) ) (go-dive self) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 3957109ac1..94d77018b5 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -453,9 +453,9 @@ (defmethod common-post ((this crimson-guard)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen common-post))) (t9-0 this) ) @@ -494,7 +494,7 @@ ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (speech-control-method-13 *speech-control* (the-as handle this)) @@ -968,7 +968,7 @@ (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face))))) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1))) @@ -1536,7 +1536,7 @@ (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) (let* ((f0-3 (vector-length s5-4)) - (f0-4 (* 0.0000012207031 f0-3)) + (f0-4 (/ f0-3 (meters 200))) (a1-9 (-> this target-pos-predict)) ) (let ((v1-62 (-> this target-pos))) @@ -1941,7 +1941,7 @@ (.svf (&-> a1-6 quad) vf6) ) (let ((f30-2 (* 0.5 (vector-vector-xz-distance s5-0 s3-0)))) - (vector-normalize! s4-0 (* 0.5 f30-2)) + (vector-normalize! s4-0 (/ f30-2 2)) (vector-normalize! s2-0 (* 2.0 f30-2)) ) (do-spline gp-0 s5-0 s4-0 s3-0 s2-0 0.9) @@ -3672,14 +3672,14 @@ (none) ) -(defmethod relocate ((this crimson-guard) (arg0 int)) +(defmethod relocate ((this crimson-guard) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) (if (nonzero? (-> this l-control)) - (&+! (-> this l-control) arg0) + (&+! (-> this l-control) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod init-enemy! ((this crimson-guard)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc index b2c51bf45e..7475325cb7 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -382,10 +382,12 @@ ) ) ) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) @@ -550,7 +552,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index e12e56909c..04f528aa15 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -380,9 +380,9 @@ (defmethod common-post ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen-enemy common-post))) (t9-0 this) ) @@ -395,7 +395,7 @@ ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (set! (-> this shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) @@ -697,7 +697,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-240 quad) vf6) (let* ((f0-5 (vector-length sv-240)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-256 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -1090,8 +1090,8 @@ (none) ) -(defmethod relocate ((this metalhead-predator) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this metalhead-predator) (offset int)) + (call-parent-method this offset) ) (defmethod init-enemy! ((this metalhead-predator)) diff --git a/goal_src/jak2/levels/city/traffic/traffic-engine.gc b/goal_src/jak2/levels/city/traffic/traffic-engine.gc index 10c75e686c..3d7484914e 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-engine.gc @@ -240,7 +240,7 @@ (defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. -The param object is updated with the ID of the box and can be later used with update-box-from-params." + The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) (let ((v1-1 0)) (b! #t cfg-4 :delay (nop!)) @@ -445,7 +445,7 @@ The param object is updated with the ID of the box and can be later used with up (defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. -Process is recycled and moved to reserved, if it deactivates." + Process is recycled and moved to reserved, if it deactivates." (with-pp (let* ((s3-0 (-> this active-object-type-list arg0)) (gp-0 'traffic-off) @@ -611,9 +611,8 @@ Process is recycled and moved to reserved, if it deactivates." (+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6)) ) ) - (set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x)) - (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)) - ) + (set! (-> s4-0 vector 2 y) + (+ (/ (-> s4-0 vector 2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) @@ -1325,7 +1324,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! decay-rate 1.5) ) ) - (set! (-> v1-1 0 decay-rate) (* 0.1 decay-rate)) + (set! (-> v1-1 0 decay-rate) (/ decay-rate 10)) (when (< (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 sphere r) danger-radius) @@ -2131,9 +2130,8 @@ Process is recycled and moved to reserved, if it deactivates." (defmethod traffic-engine-method-49 ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars - ;; og:preserve-this stack array -> pointer - (guards (pointer crimson-guard)) - (guard-target-dists (pointer float)) + (guards (array crimson-guard)) + (guard-target-dists (array float)) (guard-idx int) (sv-208 int) (sv-216 float) @@ -2180,9 +2178,8 @@ Process is recycled and moved to reserved, if it deactivates." (when (not (update-guard-status-spots target-pos)) ) (when (update-guard-status-spots target-pos) - ;; og:preserve-this stack array -> pointer - (set! guards (new 'stack-no-clear 'array 'crimson-guard 16)) - (set! guard-target-dists (new 'stack-no-clear 'array 'float 16)) + (set! guards (the-as (array crimson-guard) (new 'stack 'boxed-array crimson-guard 16))) + (set! guard-target-dists (the-as (array float) (new 'stack 'boxed-array float 16))) (set! guard-idx 0) (dotimes (guard-count (the-as int (-> this vehicle-tracker-array active-object-count))) (case (-> this vehicle-tracker-array active-object-type-list guard-count) @@ -2222,8 +2219,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (dotimes (s4-1 guard-idx) - ;; og:preserve-this stack array -> pointer - (let ((crimson-guard (-> (the-as (pointer crimson-guard) guards) s4-1))) + (let ((crimson-guard (-> (the-as (array crimson-guard) guards) s4-1))) (when (= (-> crimson-guard move-index) -1) (set! sv-208 -1) ;; og:preserve-this kinda hacky, was ps2 weird infinity. diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index 1acbaff8c6..7f7451a379 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -1017,29 +1017,29 @@ ) -(defmethod relocate ((this bikea) (arg0 int)) +(defmethod relocate ((this bikea) (offset int)) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikea)) @@ -1101,10 +1101,10 @@ (f28-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f26-0 -5) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f26-0 5) f30-0)) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) @@ -1144,32 +1144,32 @@ ) -(defmethod relocate ((this bikeb) (arg0 int)) +(defmethod relocate ((this bikeb) (offset int)) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this rudder-f)) - (&+! (-> this rudder-f) arg0) + (&+! (-> this rudder-f) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) (if (nonzero? (-> this flap-l)) - (&+! (-> this flap-l) arg0) + (&+! (-> this flap-l) offset) ) (if (nonzero? (-> this flap-r)) - (&+! (-> this flap-r) arg0) + (&+! (-> this flap-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikeb)) @@ -1231,8 +1231,8 @@ (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) @@ -1279,41 +1279,41 @@ ) -(defmethod relocate ((this bikec) (arg0 int)) +(defmethod relocate ((this bikec) (offset int)) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this fin2-fl)) - (&+! (-> this fin2-fl) arg0) + (&+! (-> this fin2-fl) offset) ) (if (nonzero? (-> this fin2-fr)) - (&+! (-> this fin2-fr) arg0) + (&+! (-> this fin2-fr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) (if (nonzero? (-> this spoiler-l)) - (&+! (-> this spoiler-l) arg0) + (&+! (-> this spoiler-l) offset) ) (if (nonzero? (-> this spoiler-r)) - (&+! (-> this spoiler-r) arg0) + (&+! (-> this spoiler-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikec)) @@ -1379,8 +1379,8 @@ (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) @@ -1440,11 +1440,11 @@ ) -(defmethod relocate ((this guard-bike) (arg0 int)) +(defmethod relocate ((this guard-bike) (offset int)) (if (nonzero? (-> this turret-jm)) - (&+! (-> this turret-jm) arg0) + (&+! (-> this turret-jm) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod start-jump ((this guard-bike)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index 419e4dbda0..133bec8cd0 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1134,35 +1134,35 @@ ) -(defmethod relocate ((this cara) (arg0 int)) +(defmethod relocate ((this cara) (offset int)) (if (nonzero? (-> this steering-wheel-l)) - (&+! (-> this steering-wheel-l) arg0) + (&+! (-> this steering-wheel-l) offset) ) (if (nonzero? (-> this steering-wheel-r)) - (&+! (-> this steering-wheel-r) arg0) + (&+! (-> this steering-wheel-r) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this rudder-l)) - (&+! (-> this rudder-l) arg0) + (&+! (-> this rudder-l) offset) ) (if (nonzero? (-> this rudder-r)) - (&+! (-> this rudder-r) arg0) + (&+! (-> this rudder-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this cara)) @@ -1279,26 +1279,26 @@ ) -(defmethod relocate ((this carb) (arg0 int)) +(defmethod relocate ((this carb) (offset int)) (if (nonzero? (-> this steering-wheel-l)) - (&+! (-> this steering-wheel-l) arg0) + (&+! (-> this steering-wheel-l) offset) ) (if (nonzero? (-> this steering-wheel-r)) - (&+! (-> this steering-wheel-r) arg0) + (&+! (-> this steering-wheel-r) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this carb)) @@ -1411,29 +1411,29 @@ ) -(defmethod relocate ((this carc) (arg0 int)) +(defmethod relocate ((this carc) (offset int)) (if (nonzero? (-> this steering-wheel)) - (&+! (-> this steering-wheel) arg0) + (&+! (-> this steering-wheel) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this fin2-rl)) - (&+! (-> this fin2-rl) arg0) + (&+! (-> this fin2-rl) offset) ) (if (nonzero? (-> this fin2-rr)) - (&+! (-> this fin2-rr) arg0) + (&+! (-> this fin2-rr) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this carc)) @@ -1503,10 +1503,10 @@ (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0))) ) 0 (none) @@ -1558,11 +1558,11 @@ ) -(defmethod relocate ((this hellcat) (arg0 int)) +(defmethod relocate ((this hellcat) (offset int)) (if (nonzero? (-> this turret-jm)) - (&+! (-> this turret-jm) arg0) + (&+! (-> this turret-jm) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this hellcat)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc index 9b4d8fb7be..5205f8128e 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc @@ -173,7 +173,7 @@ ;; WARN: Return type mismatch object vs none. (defun calc-fade-vals ((arg0 float)) "@unused just a debugging print function" - (let* ((f1-1 (* 0.00024414062 arg0)) + (let* ((f1-1 (/ arg0 METER_LENGTH)) (f0-3 (- f1-1 (the float (the int f1-1)))) (f1-3 (* 4096.0 (- f1-1 f0-3))) (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) @@ -230,14 +230,14 @@ (init-vf0-vector) (let* ((f0-0 (rand-vu-float-range 1.0 1.33)) (s4-1 (* arg3 f0-0)) - (s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1))) + (s0-0 (fmin (* arg2 f0-0) (/ s4-1 2))) (s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3)) (s2-0 (-> this info)) ) (let ((a1-2 (-> s3-1 0 normal))) (let ((v1-2 arg0)) (let ((a0-2 arg1)) - (let ((a2-2 (* 0.25 s4-1))) + (let ((a2-2 (/ s4-1 4))) (.mov vf7 a2-2) ) (.lvf vf5 (&-> a0-2 quad)) @@ -265,13 +265,13 @@ (let ((f0-14 (* 4.0 s0-0))) (set! (-> s3-1 1 local-pos w) f0-14) (set! (-> s3-1 1 normal w) f0-14) - (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) + (set! (-> s3-1 1 normal x) (/ f0-14 40)) ) (add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1))) (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) - (let ((a0-10 (* 0.5 s4-1))) + (let ((a0-10 (/ s4-1 2))) (.mov vf7 a0-10) ) (.lvf vf5 (&-> arg1 quad)) @@ -451,7 +451,7 @@ (-> this info part-vel) (-> this rbody state lin-velocity) (-> s5-0 0 vector 1) - (* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + (* (/ (-> this info max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor))) ) (let ((v1-117 (-> this info part-vel)) (a0-45 (-> this info part-vel)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index 9a72fc8842..564661025a 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -323,7 +323,7 @@ (-> gp-0 vec-12 x) ) ) - (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10))))) (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> this info rot-min s3-1))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc index a4da63f957..04227cf5b0 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc @@ -29,7 +29,7 @@ (let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) 0.0 (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) - (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) + (f30-0 (+ 0.5 (* (/ f2-5 -4) f2-5 f2-5) (* 0.75 f2-5))) ) (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) (let ((v1-18 (-> this rbody)) @@ -303,8 +303,8 @@ (let ((f1-20 (fmax 0.0 f0-38))) (+! (-> this lift-thrust s2-1) f1-20) (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) - (+! (-> this roll-thrust 0) (* 0.05 f1-20)) - (+! (-> this roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this roll-thrust 0) (/ f1-20 20)) + (+! (-> this roll-thrust 1) (/ f1-20 20)) ) ) (vector-reset! (-> arg1 force)) @@ -326,7 +326,7 @@ (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count))) + (let ((f0-43 (/ (-> this info inv-lift-thruster-count) -4)) (f1-28 arg0) ) (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index 8a74f33d2b..8cf2ba4e52 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -151,11 +151,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -419,7 +419,7 @@ This commonly includes things such as: (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) - (f1-6 (* 0.005 f0-6)) + (f1-6 (/ f0-6 200)) ) (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index a76261fd9d..6ba16fb7e2 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -453,7 +453,7 @@ (set! f1-6 (* f0-23 f0-23)) ) (if (not (logtest? (-> this flags) (rigid-body-object-flag riding))) - (set! f1-6 (* 0.5 f1-6)) + (set! f1-6 (/ f1-6 2)) ) ) (+! (-> this power-level) @@ -1230,7 +1230,7 @@ ) (when (< f0-9 (* f1-8 f1-8)) (let ((f0-10 (vector-length (-> this root transv)))) - (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame))) ) (do-engine-sounds this) ) @@ -1517,7 +1517,7 @@ ((or (logtest? (penetrate dark-giant) arg3) (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) - (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) + (set! (-> s5-0 vector 2 y) (/ (-> s5-0 vector 2 y) 10)) (set! f0-2 (* 409600.0 (-> this info info mass))) (/ 0.4 (-> this info damage-factor)) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc index d4d384e3d3..4f270c9ce5 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc @@ -192,7 +192,7 @@ (static-sound-name "sig-gun-powerup") (-> this powerup-sound-id) (the int (* 1024.0 f28-0)) - (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) + (the int (* 1524.0 (+ 0.5 (/ f30-0 2)))) 0 (sound-group sfx) s4-0 diff --git a/goal_src/jak2/levels/common/ai/sig/sig-states.gc b/goal_src/jak2/levels/common/ai/sig/sig-states.gc index 4c10258cb9..74c6c4bc2c 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-states.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-states.gc @@ -1493,7 +1493,7 @@ (until #f (suspend) (let* ((f0-1 (vector-length (-> self root transv))) - (f0-3 (fmax 0.1 (* 0.000020345053 f0-1))) + (f0-3 (fmax 0.1 (/ f0-1 (meters 12)))) ) (ja :num! (loop! f0-3)) ) @@ -1612,14 +1612,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-run-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) @@ -1744,14 +1744,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-shoot-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 91baaf6ef8..ef168bb6a5 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -958,19 +958,19 @@ (cond ((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0))) (logior! (-> this bot-flags) (bot-flags bf23)) - (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) + (let ((f2-3 (fmax 12288.0 (/ f1-0 2))) (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) ) (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3) ) ) (else - (fmax 2048.0 (* 0.2 f1-0)) + (fmax 2048.0 (/ f1-0 5)) ) ) ) ) - (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2)) + (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (/ f0-2 90000)) ) ) (none) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 226279a06e..48d766d2e4 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -750,6 +750,7 @@ ) (defmethod deactivate ((this elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set-elec-scale-if-close! this 0.0) (call-parent-method this) (none) @@ -773,9 +774,9 @@ (defmethod set-state! ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed -make the gate `idle`. - -Otherwise, the gate will be `active`." + make the gate `idle`. + + Otherwise, the gate will be `active`." (if (or (logtest? (actor-option user17) (-> this fact options)) (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) @@ -788,11 +789,11 @@ Otherwise, the gate will be `active`." (defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -841,7 +842,7 @@ This commonly includes things such as: (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (set! (-> this wall-xz) (/ (-> this wall-xz) 2)) (+! (-> this wall-xz) 4096.0) (set! (-> this wall-y) (fabs @@ -874,8 +875,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-fordumpa-electricity-scale! scale) (set-forresca-electricity-scale! scale (-> this palette-id)) (set-forrescb-electricity-scale! scale (-> this palette-id)) @@ -898,8 +899,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-drill-electricity-scale! arg0 (-> this palette-id)) 0 (none) @@ -924,8 +925,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-castle-electricity-scale! arg0) 0 (none) @@ -995,8 +996,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-palroof-electricity-scale! arg0 (-> this palette-id)) 0 (none) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index e0610aa23c..4e55e27ab9 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -675,7 +675,7 @@ (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad)) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0))) (let* ((f0-0 (vector-length s1-2)) - (f0-1 (* 0.0000030517579 f0-0)) + (f0-1 (/ f0-0 (meters 80))) (a0-7 s2-0) ) (let ((v1-17 s2-0)) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 2609429f7b..b70f673a13 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -857,7 +857,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 8e1072b32e..64906628b4 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -1372,10 +1372,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1397,7 +1397,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-14)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-15 (* f26-0 f0-14))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-15)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-15 -2)) ) ) ) @@ -1473,7 +1473,7 @@ ) (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) f1-0) ) - (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-0)))) + (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-0 -2)))) (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index 7314e1f99c..54664394a5 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -1453,7 +1453,7 @@ (vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0) (vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0) (set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans))) - (set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0))) + (set! (-> s5-0 pos-index 1) (/ (* (/ (-> s5-0 pos-index 0) 2) (-> s5-0 pos-index 0)) (/ f28-0 5))) (set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans))) (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed)) (vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0) @@ -1674,9 +1674,9 @@ (none) ) -(defmethod relocate ((this hover-nav-control) (arg0 int)) +(defmethod relocate ((this hover-nav-control) (offset int)) (if (nonzero? (-> this root)) - (&+! (-> this root) arg0) + (&+! (-> this root) offset) ) this ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc index 77e8a47332..af89de6d11 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc @@ -26,7 +26,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> arg0 quad)) (let* ((f0-2 (vector-vector-distance s4-0 arg1)) - (s3-1 (+ (the int (* 0.000008138021 f0-2)) 1)) + (s3-1 (+ (the int (/ f0-2 (meters 30))) 1)) (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) 110592.0)) ) (dotimes (s1-0 s3-1) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index 16a2afa6a6..f316675413 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -1210,10 +1210,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1237,7 +1237,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-15)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-16 (* f26-0 f0-15))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-16)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-16 -2)) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 7c02f83a71..43109ad34d 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -1035,7 +1035,7 @@ ) ) (let ((v1-17 (-> self nav))) - (set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate))) + (set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20)) ) 0 (ja-channel-push! 2 (seconds 0.2)) @@ -1067,8 +1067,7 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (suspend-for - (seconds 0.2) + (suspend-for (seconds 0.2) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index 6c91ae73c5..1b61881a8e 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -516,7 +516,7 @@ (* 40.96 (seconds-per-frame)) ) ) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-7 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -552,7 +552,7 @@ :code sleep-code :post (behavior () (seek! (-> self y-offset) -81920.0 (* 49152.0 (seconds-per-frame))) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-5 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -826,7 +826,8 @@ (gun-buoy-method-183 self a1-1) ) ) - (suspend-for (seconds 0.75)) + (suspend-for (seconds 0.75) + ) ) (go-virtual hostile) ) @@ -852,7 +853,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (go-virtual exit-ambush) ) :post gun-buoy-chase-post @@ -1093,7 +1095,7 @@ (f1-1 (-> this elev-angle)) (f0-7 (fmax -728.1778 (fmin 728.1778 f1-1))) (f1-2 (- f1-1 f0-7)) - (f2-3 (* 0.2 f1-2)) + (f2-3 (/ f1-2 5)) (f30-0 (+ f0-7 (* 0.8 f1-2))) ) (quaternion-vector-angle! s5-1 *x-vector* f2-3) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index ad664122d4..077c8ce8ba 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -703,7 +703,7 @@ (set! (-> this old-y-deg) f0-5) ) (set! (-> this desire-turn) - (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) ) (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) (-> this next-state) @@ -1039,7 +1039,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-43 (ja-group))) @@ -1094,7 +1094,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) @@ -1150,7 +1150,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) diff --git a/goal_src/jak2/levels/common/guard-projectile.gc b/goal_src/jak2/levels/common/guard-projectile.gc index 9a03d5e650..c5cc24ce63 100644 --- a/goal_src/jak2/levels/common/guard-projectile.gc +++ b/goal_src/jak2/levels/common/guard-projectile.gc @@ -383,7 +383,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/levels/common/metalhead-projectile.gc b/goal_src/jak2/levels/common/metalhead-projectile.gc index b25ea7323c..30033922d8 100644 --- a/goal_src/jak2/levels/common/metalhead-projectile.gc +++ b/goal_src/jak2/levels/common/metalhead-projectile.gc @@ -369,7 +369,7 @@ (launch-particles (-> *part-id-table* 622) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index 30a74a248a..c164761d2a 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -815,7 +815,7 @@ (let ((v1-3 (new 'stack-no-clear 'mystery-race-manager-type))) (set! (-> v1-3 vec1 z) 81920.0) (set! (-> v1-3 word) 4) - (set! (-> v1-3 vec0 z) (* -0.5 (-> v1-3 vec1 z))) + (set! (-> v1-3 vec0 z) (/ (-> v1-3 vec1 z) -2)) (set! (-> v1-3 vec0 w) -20480.0) (set! (-> v1-3 vec1 x) (/ (-> v1-3 vec1 z) (the float (+ (-> v1-3 word) -1)))) (set! (-> v1-3 vec1 y) -40960.0) @@ -1235,7 +1235,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1263,7 +1263,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 35)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1564,6 +1564,7 @@ (define *race-manager* (the-as (pointer race-manager) #f)) (defmethod deactivate ((this race-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) diff --git a/goal_src/jak2/levels/common/race/race-mesh.gc b/goal_src/jak2/levels/common/race/race-mesh.gc index 091fb01fc0..fd09481ecc 100644 --- a/goal_src/jak2/levels/common/race/race-mesh.gc +++ b/goal_src/jak2/levels/common/race/race-mesh.gc @@ -705,7 +705,7 @@ (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) - (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + (f1-2 (fmin (-> arg0 search-sphere r) (/ (-> s4-0 cell-length) 2))) ) (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) (f2-4 (- (-> arg0 search-sphere z) f1-2)) @@ -739,7 +739,7 @@ (+! s2-0 1) ) ) - (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (when (and (= (-> arg0 slice-id) -1) (< (/ (-> s4-0 cell-length) 2) (-> arg0 search-sphere r))) (while (= (-> arg0 slice-id) -1) (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) diff --git a/goal_src/jak2/levels/consite/consite-scenes.gc b/goal_src/jak2/levels/consite/consite-scenes.gc index 3a79a13df3..83ba334398 100644 --- a/goal_src/jak2/levels/consite/consite-scenes.gc +++ b/goal_src/jak2/levels/consite/consite-scenes.gc @@ -612,7 +612,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index ef573a4129..fe65b944ee 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -1013,7 +1013,7 @@ (set! (-> gp-0 vector 2 w) 0.0) (matrix->quaternion (-> self root quat) gp-0) ) - (set! (-> self root scale z) (* 0.000003937752 f30-0)) + (set! (-> self root scale z) (/ f30-0 (meters 62))) (when (!= (-> self old-dist) 0.0) (let ((f2-0 (fabs (- f30-0 (-> self old-dist))))) (set! (-> self frame target) (fmin 1.0 (fmax 0.0 (* 0.0008719308 (- 573.44 f2-0))))) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index 827ccbfb61..c52750f406 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -831,7 +831,7 @@ (let* ((f30-0 (the float (ja-num-frames 0))) (f0-10 (+ (* 1.5 f30-0 (get-norm! (-> self parent-ptr 0 swing-sync) 0)) (if (= (-> self parent-ptr 0 options) 1) - (* 0.5 f30-0) + (/ f30-0 2) 0.0 ) ) @@ -850,7 +850,7 @@ 1.0 0.0 ) - (* 0.02 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 50) ) (dig-balloon-lurker-trapeze-method-21 self) (suspend) @@ -1055,7 +1055,7 @@ -0.5 0.5 ) - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) (let ((f0-7 (+ -1.0 (fabs (* 2.0 (-> self pedal-anim-speed))))) (f1-5 (* 2.0 (fabs (-> self pedal-anim-speed)))) @@ -1253,7 +1253,7 @@ ) ) ) - (set! (-> this anim-speed) (* 0.000015258789 f0-18)) + (set! (-> this anim-speed) (/ f0-18 (meters 16))) ) (go (method-of-object this idle)) (none) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index b76828af54..3fbb948247 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -1219,7 +1219,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (set! (-> self root trans y) @@ -1300,8 +1300,8 @@ (else (set! (-> self from-y) (-> self current-y-position)) (let ((f0-6 (fabs (- (+ f30-0 (-> v1-35 ship-y-offset)) (-> self from-y))))) - (set! (-> self inc-y) (* 0.02 f0-6)) - (set! (-> self ease-y) (* 0.2 f0-6)) + (set! (-> self inc-y) (/ f0-6 50)) + (set! (-> self ease-y) (/ f0-6 5)) ) ) ) @@ -1318,7 +1318,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (if (and (= (-> self current-y-position) f28-0) (-> s5-0 alive)) @@ -1371,7 +1371,7 @@ 0.0 (* 5.0 (-> pp clock time-adjust-ratio)) 90.0 - (* 0.1 (-> pp clock time-adjust-ratio)) + (/ (-> pp clock time-adjust-ratio) 10) ) ) ) @@ -1806,7 +1806,7 @@ ) ) (until #f - (seek! (-> self anim-frame) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-12 (-> self skel root-channel 0))) (set! (-> v1-12 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) @@ -1945,7 +1945,7 @@ ) :code (behavior () (until #f - (seek! (-> self anim-frame) 0.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-4 (-> self skel root-channel 0))) (set! (-> v1-4 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 985773f0c8..dda1d1073c 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -342,7 +342,7 @@ (until #f (let ((f30-0 (- (-> self extent 1 y) (-> self extent 0 y)))) (when (!= f30-0 (-> self length)) - (let ((f0-3 (* 0.000010172526 f30-0))) + (let ((f0-3 (/ f30-0 (meters 24)))) (ja :num! (identity f0-3)) ) (transform-post) @@ -737,16 +737,16 @@ (set! (-> s0-0 random-rangef) f30-0) ) (if s5-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if gp-0 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) (if s4-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if v1-22 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part) (-> self local-to-world)) @@ -769,10 +769,10 @@ (set! (-> s4-1 random-rangef) f30-0) ) (if gp-1 - (set! (-> gp-1 random-rangef) (* 0.5 f28-0)) + (set! (-> gp-1 random-rangef) (/ f28-0 2)) ) (if v1-39 - (set! (-> v1-39 random-rangef) (* 0.5 f30-0)) + (set! (-> v1-39 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part-off) (-> self local-to-world)) @@ -883,9 +883,9 @@ (set! (-> this deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) (let ((v1-39 (-> this root root-prim))) (vector-reset! (-> v1-39 local-sphere)) - (let* ((f0-14 (* 0.5 (-> this deadly-width))) + (let* ((f0-14 (/ (-> this deadly-width) 2)) (f0-16 (* f0-14 f0-14)) - (f1-7 (* 0.5 (-> this deadly-length))) + (f1-7 (/ (-> this deadly-length) 2)) ) (set! (-> v1-39 local-sphere w) (sqrtf (+ f0-16 (* f1-7 f1-7)))) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index f2a37cb0df..e149549c9f 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -501,7 +501,7 @@ s4-0 s4-0 s5-3 - (* (fmax 0.5 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> this nav state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 18a9cadfd7..f522240a36 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -151,7 +151,7 @@ (go-virtual dormant) ) ) - (set! (-> *game-info* bot-health 0) (* 0.11111111 (-> self hit-points))) + (set! (-> *game-info* bot-health 0) (/ (-> self hit-points) 9)) (transform-post) (none) ) @@ -343,7 +343,8 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (send-event *camera* 'change-target #f) (cleanup-for-death self) ) @@ -594,7 +595,8 @@ (lambda :behavior task-manager () (set-time! (-> self start-time)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (let ((s5-0 (entity-by-name "transport-level-1")) (gp-1 (entity-by-name "transport-level-2")) ) @@ -663,7 +665,8 @@ ) ) ) - (suspend-for (seconds 15)) + (suspend-for (seconds 15) + ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 1) @@ -697,7 +700,8 @@ ) ) (dotimes (s3-1 3) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 1) @@ -730,7 +734,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) (set! (-> a1-8 num-params) 1) @@ -764,7 +769,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) (set! (-> a1-10 num-params) 1) @@ -797,7 +803,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (dotimes (s3-4 10) (let ((v1-114 s4-0)) (if (not (if v1-114 @@ -807,7 +814,8 @@ (goto cfg-74) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) (label cfg-74) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) @@ -882,21 +890,25 @@ ) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (set-setting! 'entity-name "camera-260" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (send-event (if s5-0 (-> s5-0 extra process) ) 'leave ) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (send-event (if gp-1 (-> gp-1 extra process) @@ -904,11 +916,13 @@ 'leave ) ) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (go-virtual complete) (while *target* (suspend) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index c2d3d00b32..53547336a5 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -187,8 +187,8 @@ ;; WARN: Return type mismatch int vs enemy-aware. (defmethod update-target-awareness! ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! -For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] -@returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" + For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] + @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" (the-as enemy-aware (if (time-elapsed? (-> this targetted-timer) (seconds 5)) (the-as int ((method-of-type enemy update-target-awareness!) this proc focus)) 4 @@ -198,7 +198,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett (defmethod general-event-handler ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type (('track) #f @@ -237,9 +237,9 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett (defmethod damage-amount-from-attack ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. -This is why the scouts are technically killable by other means -@returns the amount of damage taken from an attack. Also updates the `targetted-timer`. -@see [[*pegasus-enemy-info*]]" + This is why the scouts are technically killable by other means + @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. + @see [[*pegasus-enemy-info*]]" (let ((hitpoints 1)) (let ((attack-info (the-as attack-info (-> arg1 param 1)))) (case (-> arg1 message) @@ -258,10 +258,10 @@ This is why the scouts are technically killable by other means ;; WARN: Return type mismatch symbol vs none. (defbehavior pegasus-draw-section pegasus ((path-percent-a float) (path-percent-b float) (color rgba)) "Draws the [[pegasus]] curve section between the two provided points. -@param path-percent-a Percentage along the path for the first point -@param path-percent-b Percentage along the path for the second point -param color The color to draw the curve with -@see [[curve-control]]" + @param path-percent-a Percentage along the path for the first point + @param path-percent-b Percentage along the path for the second point + param color The color to draw the curve with + @see [[curve-control]]" (let ((point-a (new 'stack-no-clear 'vector)) (point-b (new 'stack-no-clear 'vector)) ) @@ -284,9 +284,9 @@ param color The color to draw the curve with (defbehavior pegasus-show-runs pegasus () "When [[*display-path-marks*]] is enabled, allow the user to cycle through the displayed path -- Pressing [[up]] on the D-Pad will increment the path index -- Pressing [[down]] on the D-Pad will decrement the path index -Additional debug text will be displayed as well. This is useful as many paths overlap other paths" + - Pressing [[up]] on the D-Pad will increment the path index + - Pressing [[down]] on the D-Pad will decrement the path index + Additional debug text will be displayed as well. This is useful as many paths overlap other paths" (when *display-path-marks* (when (cpad-pressed? 0 up) (+! (-> self display-path) 1) @@ -335,10 +335,10 @@ Additional debug text will be displayed as well. This is useful as many paths o ;; WARN: Return type mismatch vector vs none. (defbehavior pegasus-rotate pegasus ((influenced-by-target? symbol) (angle float)) "Rotates the [[pegasus]] along the path, factoring in the current speed and the target's position -@param influenced-by-target? Whether or not to care about [[target]]'s position -@param angle The hopeful angle to use when constructing the rotation matrix, ultimately limited to `0.25` (radians?) though -@see [[target-pos]] and [[matrix-from-two-vectors-max-angle-partial!]] -@TODO - `float` should be `degrees` -- The usual amount passed in is `(degrees 100.0835)`" + @param influenced-by-target? Whether or not to care about [[target]]'s position + @param angle The hopeful angle to use when constructing the rotation matrix, ultimately limited to `0.25` (radians?) though + @see [[target-pos]] and [[matrix-from-two-vectors-max-angle-partial!]] + @TODO - `float` should be `degrees` -- The usual amount passed in is `(degrees 100.0835)`" (let ((rotation-matrix (new 'stack-no-clear 'matrix)) (flee-direction-vec (new 'stack-no-clear 'vector)) ) @@ -380,14 +380,14 @@ Additional debug text will be displayed as well. This is useful as many paths o ;; WARN: Return type mismatch float vs none. (defbehavior pegasus-loop-on-same-path pegasus () "Creates an endless loop on the same path as the name suggests -- If we are beyond the end of the path, start again near the beginning (1%) -- If we are far before the beginning, start at the beginning (0%) -- If we are atleast 1% into the path, step back 1% -- If we are less than 0% somehow, slowly add 1% -Ultimately this appears to be some sort of safe-guard to get things back into a somewhat working state -if there are unexpected path conditions -- but the results of this are not great! -Another potential explaination is to make it easy during development to identify and debug a bad path -In practice, this is never called" + - If we are beyond the end of the path, start again near the beginning (1%) + - If we are far before the beginning, start at the beginning (0%) + - If we are atleast 1% into the path, step back 1% + - If we are less than 0% somehow, slowly add 1% + Ultimately this appears to be some sort of safe-guard to get things back into a somewhat working state + if there are unexpected path conditions -- but the results of this are not great! + Another potential explaination is to make it easy during development to identify and debug a bad path + In practice, this is never called" (cond ((< 100.0 (-> self curve-position)) (set! (-> self curve-position) 1.0) @@ -407,9 +407,9 @@ In practice, this is never called" (defbehavior pegasus-choose-path pegasus () "Determines the next path the pegasus should take if we have completed the current path it's on -There are many fail-safes here if something goes wrong to try to keep the pegasus behaving -@see [[pegasus-look-on-same-path]] -@TODO - understand the path selection better" + There are many fail-safes here if something goes wrong to try to keep the pegasus behaving + @see [[pegasus-look-on-same-path]] + @TODO - understand the path selection better" (local-vars (f0-15 float) (f30-0 float)) (while (begin (label cfg-61) (or (< 1.0 (-> self curve-position)) (< (-> self curve-position) 0.0))) (let ((curr-pegasus-path (-> self path-info (-> self current-path))) @@ -523,8 +523,8 @@ There are many fail-safes here if something goes wrong to try to keep the pegasu (defbehavior pegasus-move pegasus ((explicit-y-vel float) (adjust-y-offset? symbol)) "Moves the pegasus along the path by smoothly interpolating along it -@param explicit-y-vel Normally `0.0` but this value is used when the pegasus needs to switch direction -@param adjust-y-offset? Normally [[#f]] which forces the movement to reflect the result of the collison query - the [[pegasus]] will stay close to the ground. [[#t]] ignores this" + @param explicit-y-vel Normally `0.0` but this value is used when the pegasus needs to switch direction + @param adjust-y-offset? Normally [[#f]] which forces the movement to reflect the result of the collison query - the [[pegasus]] will stay close to the ground. [[#t]] ignores this" (+! (-> self curve-position) (/ (the float (* (- (current-time) (-> self clock old-frame-counter)) (the int (-> self speed)))) (total-distance (-> self path-info (-> self current-path) path-data)) @@ -612,13 +612,13 @@ There are many fail-safes here if something goes wrong to try to keep the pegasu (defbehavior pegasus-calc-speed pegasus ((min-dist float) (max-dist float) (max-speed float) (min-speed float)) "Calculates the pegasus' speed based on a number of factors: -- Speed up as the target gets closer (up to a max) and slow down as the target is further away (up to a min) -This function also is what causes the pegasus to flip around -@param min-dist TODO -@param max-dist TODO -@param max-speed The maximum speed the pegasus can go -@param min-speed The minimum speed the pegasus can go -@returns If there should be a reaction to the target via [[enemy::72]]" + - Speed up as the target gets closer (up to a max) and slow down as the target is further away (up to a min) + This function also is what causes the pegasus to flip around + @param min-dist TODO + @param max-dist TODO + @param max-speed The maximum speed the pegasus can go + @param min-speed The minimum speed the pegasus can go + @returns If there should be a reaction to the target via [[enemy::72]]" (let ((dir-to-target (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) (react-to-target? #f) ) @@ -630,7 +630,7 @@ This function also is what causes the pegasus to flip around (if (not (time-elapsed? (-> self targetted-timer) (seconds 5))) (set! interpolated-speed (fmax 163840.0 interpolated-speed)) ) - (let ((movement-speed (* 0.0033333334 interpolated-speed))) + (let ((movement-speed (/ interpolated-speed 300))) (cond ((< (vector-dot dir-to-target (-> self tangent)) 0.0) (if (< 0.0 (-> self speed)) @@ -676,9 +676,9 @@ This function also is what causes the pegasus to flip around (defbehavior pegasus-calc-anim-speed pegasus () "Based on `speed`, adjust how fast the pegasus should animate. -The faster it's moving the fast it flaps it's wings, etc -@TODO understand the magic values here better -@returns The anim speed, it can be no lower than `1.5`" + The faster it's moving the fast it flaps it's wings, etc + @TODO understand the magic values here better + @returns The anim speed, it can be no lower than `1.5`" (let* ((speed-abs (fabs (-> self speed))) (f0-2 (* 0.07324219 speed-abs)) (f0-3 (+ -15.0 f0-2)) @@ -690,9 +690,9 @@ The faster it's moving the fast it flaps it's wings, etc (defmethod common-post ((this pegasus)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (track-how-long-aimed-at! this) (pegasus-show-runs) ((method-of-type enemy common-post) this) @@ -827,7 +827,7 @@ The faster it's moving the fast it flaps it's wings, etc (defbehavior pegasus-fly-code pegasus ((arg0 int)) "Handles the flying animations and sounds -@TODO - cleanup a bit more" + @TODO - cleanup a bit more" (let ((anim-speed (pegasus-calc-anim-speed))) (let ((gp-0 (and (-> self can-run) (< (the-as time-frame (-> self ambient-possible)) (current-time))))) (let* ((min-dist (lerp-scale 61440.0 32768.0 (the float arg0) 0.0 3000.0)) @@ -1253,13 +1253,13 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate ((this pegasus) (arg0 int)) +(defmethod relocate ((this pegasus) (offset int)) (countdown (v1-0 20) (if (-> this path-info v1-0 path-data) - (&+! (-> this path-info v1-0 path-data) arg0) + (&+! (-> this path-info v1-0 path-data) offset) ) ) - (the-as pegasus ((method-of-type enemy relocate) this arg0)) + (the-as pegasus ((method-of-type enemy relocate) this offset)) ) (defmethod init-enemy! ((this pegasus)) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index e5e59abb09..b843346b78 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -405,7 +405,7 @@ (defmethod general-event-handler ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (set! (-> this shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) @@ -707,7 +707,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-224 quad) vf6) (let* ((f0-5 (vector-length sv-224)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-240 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -1310,9 +1310,9 @@ (defmethod common-post ((this predator)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -1416,8 +1416,8 @@ (none) ) -(defmethod relocate ((this predator) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this predator) (offset int)) + (call-parent-method this offset) ) (defmethod nav-enemy-method-167 ((this predator)) @@ -1434,6 +1434,7 @@ ) (defmethod run-logic? ((this predator)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -1450,11 +1451,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -1534,12 +1535,12 @@ This commonly includes things such as: (define *predator-manager* (the-as predator-manager #f)) ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate ((this predator-manager) (arg0 int)) +(defmethod relocate ((this predator-manager) (offset int)) (set! *predator-manager* this) (if *predator-manager* - (set! *predator-manager* (&+ *predator-manager* arg0)) + (set! *predator-manager* (&+ *predator-manager* offset)) ) - (the-as predator-manager ((method-of-type process relocate) this arg0)) + (the-as predator-manager ((method-of-type process relocate) this offset)) ) (defmethod predator-manager-method-16 ((this predator-manager)) @@ -1594,11 +1595,11 @@ This commonly includes things such as: ;; WARN: new jak 2 until loop case, check carefully (defmethod init-from-entity! ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 72a5a000b6..ab93266622 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -126,7 +126,7 @@ ;; WARN: Return type mismatch object vs symbol. (defmethod spooked? ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. -If so, it transitions from [[wren::peck]] to [[wren::hunt]]" + If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) gp-0 @@ -315,7 +315,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (seek! (-> self fly-interp) (lerp-scale 0.0 1.0 f0-11 -0.2 0.5) (seconds-per-frame)) ) (let ((f30-1 (-> self fly-interp))) - (seek! (-> self path-du-mod) (+ 0.9 (* 0.2 f30-1)) (* 0.5 (seconds-per-frame))) + (seek! (-> self path-du-mod) (+ 0.9 (/ f30-1 5)) (* 0.5 (seconds-per-frame))) (set! (-> self bob-level-seek) (+ -12288.0 (* 24576.0 f30-1))) (let ((v1-59 (-> self skel root-channel 0))) (let ((f0-23 (- 1.0 f30-1))) @@ -437,11 +437,11 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index fe089b994a..7417072ab0 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -191,8 +191,8 @@ :code (behavior () (until #f (when (and (not (paused?)) (time-elapsed? (-> self state-time) (seconds 1))) - (seek! (-> self anim-frame) 0.0 (* 0.2 (-> self clock time-adjust-ratio))) - (seek! (-> self transition) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 5)) + (seek! (-> self transition) 1.0 (/ (-> self clock time-adjust-ratio) 100)) ) (set-roboscreen-alpha! (-> self transition)) (ja :num-func num-func-identity :frame-num (-> self anim-frame)) @@ -218,7 +218,7 @@ :code (behavior () (until #f (when (not (paused?)) - (seek! (-> self anim-frame) 15.0 (* 0.2 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 15.0 (/ (-> self clock time-adjust-ratio) 5)) (seek! (-> self transition) 0.0 (* 0.015 (-> self clock time-adjust-ratio))) ) (set-roboscreen-alpha! (-> self transition)) @@ -432,7 +432,7 @@ (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-0) (the-as vector s5-0)))) (gp-1 (-> self sight-scale)) ) - (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (set! (-> gp-1 z) (/ f0-0 (meters 10))) (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) (set! (-> gp-1 x) f0-1) (set! (-> gp-1 y) f0-1) @@ -902,7 +902,7 @@ (let* ((f0-29 (fmax -4551.1113 (fmin 4551.1113 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) (f2-1 (- (-> self gun-elev-cam) f0-29)) (f1-12 (if (< f2-1 0.0) - (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + (fmin 3640.889 (* (fabs (/ f2-1 10)) (-> self clock frames-per-second))) 910.2222 ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 483d4e52e1..b26343a42b 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -374,7 +374,7 @@ (f1-16 (- 1.0 f0-44)) (f26-0 0.0) ) - (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f30-2)))) + (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (/ f30-2 2)))) (let* ((gp-2 *target*) (a0-43 (if (type? gp-2 process-focusable) gp-2 @@ -391,7 +391,7 @@ (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.49 f26-0))) - (the-as time-frame (max 45 (the int (* 0.25 f30-2)))) + (the-as time-frame (max 45 (the int (/ f30-2 4)))) ) (set-time! (-> self buzz-timer)) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 23f7a70a8d..02972ffff4 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -37,11 +37,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -227,14 +227,14 @@ This commonly includes things such as: (+! (-> s4-1 y) (sqrtf (- f0-6 f2-2))) ) (let* ((f0-12 (* 2.0 (asin (/ f1-4 f30-0)))) - (f28-1 (* 0.0625 f0-12)) + (f28-1 (/ f0-12 16)) (s3-1 (new 'stack-no-clear 'vector)) ) (set! (-> s3-1 x) 0.0) (set! (-> s3-1 y) (- f30-0)) (set! (-> s3-1 z) 0.0) (set! (-> s3-1 w) 0.0) - (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (* -0.5 f0-12)))) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (/ f0-12 -2)))) (vector-orient-by-quat! s3-1 s3-1 a2-2) ) (dotimes (s2-1 17) @@ -374,14 +374,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate ((this fort-elec-belt-inst) (arg0 int)) +(defmethod relocate ((this fort-elec-belt-inst) (offset int)) (if (nonzero? (-> this l-bolt)) - (&+! (-> this l-bolt) arg0) + (&+! (-> this l-bolt) offset) ) - (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this arg0)) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this offset)) ) (defmethod deactivate ((this fort-elec-belt-inst)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -509,21 +510,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate ((this fort-elec-belt) (arg0 int)) +(defmethod relocate ((this fort-elec-belt) (offset int)) (if (nonzero? (-> this path)) - (&+! (-> this path) arg0) + (&+! (-> this path) offset) ) - (the-as fort-elec-belt ((method-of-type process relocate) this arg0)) + (the-as fort-elec-belt ((method-of-type process relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-64 int)) (quaternion-copy! (-> this init-quat) (-> arg0 quat)) (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) @@ -643,7 +644,7 @@ This commonly includes things such as: (defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] -and return it as well. Otherwise, set it to `0`" + and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 39ca303d25..28623c942a 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -2237,7 +2237,7 @@ (let ((f0-2 1.0)) (cond ((< f30-0 2.0) - (set! f0-2 (* 0.5 f30-0)) + (set! f0-2 (/ f30-0 2)) ) ((< 3.0 f30-0) (set! f0-2 (* 0.5 (- 5.0 f30-0))) @@ -2359,7 +2359,7 @@ (let ((f0-6 1.0)) (cond ((< f30-0 2.0) - (set! f0-6 (* 0.5 f30-0)) + (set! f0-6 (/ f30-0 2)) ) ((< 6.0 f30-0) (set! f0-6 (* 0.5 (- 8.0 f30-0))) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 4ff58b9642..05a6409116 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -467,8 +467,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-2 quad) vf6) ) - (let* ((a0-30 (the int (* 0.00024414062 (-> s0-1 x)))) - (a1-20 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((a0-30 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a1-20 (the int (/ (-> s0-1 z) METER_LENGTH))) (a0-32 (/ (- *dice-offset-x* a0-30) -4)) ) (if (not (logtest? (-> *dice-blocked-array* (/ (- *dice-offset-z* a1-20) -4)) (ash 1 (- 15 a0-32)))) @@ -507,8 +507,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-13 quad) vf6) ) - (let* ((v1-15 (the int (* 0.00024414062 (-> s0-1 x)))) - (a0-48 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((v1-15 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a0-48 (the int (/ (-> s0-1 z) METER_LENGTH))) (v1-17 (/ (- *dice-offset-x* v1-15) -4)) (a1-31 (/ (- *dice-offset-z* a0-48) -4)) ) @@ -867,8 +867,8 @@ (set! (-> self color z) (-> self color x)) (set! (-> self draw color-mult quad) (-> self color quad)) (when (zero? (-> self active)) - (let* ((v1-15 (the int (* 0.00024414062 (-> self root trans x)))) - (a0-5 (the int (* 0.00024414062 (-> self root trans z)))) + (let* ((v1-15 (the int (/ (-> self root trans x) METER_LENGTH))) + (a0-5 (the int (/ (-> self root trans z) METER_LENGTH))) (s5-0 (/ (- *dice-offset-x* v1-15) -4)) (gp-0 (/ (- *dice-offset-z* a0-5) -4)) ) @@ -1065,8 +1065,8 @@ (set! (-> v1-9 quad 2) a2-1) (set! (-> v1-9 trans quad) a3-1) ) - (let ((v1-12 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans x))))) - (a0-14 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans z))))) + (let ((v1-12 (the int (+ 2.0 (/ (-> s1-0 trans x) METER_LENGTH)))) + (a0-14 (the int (+ 2.0 (/ (-> s1-0 trans z) METER_LENGTH)))) ) (set! sv-544 (/ (- *dice-offset-x* v1-12) -4)) (let ((s0-0 (/ (- *dice-offset-z* a0-14) -4))) @@ -1153,8 +1153,8 @@ (set! (-> sv-608 y) (get-ripple-height s0-1 sv-608)) (vector-! sv-576 sv-576 sv-560) (vector-! sv-608 sv-608 sv-560) - (set! (-> sv-576 y) (* 0.5 (-> sv-576 y))) - (set! (-> sv-608 y) (* 0.5 (-> sv-608 y))) + (set! (-> sv-576 y) (/ (-> sv-576 y) 2)) + (set! (-> sv-608 y) (/ (-> sv-608 y) 2)) (set! (-> sv-576 w) 0.0) (set! (-> sv-592 w) 0.0) (set! (-> sv-608 w) 0.0) @@ -1364,9 +1364,9 @@ (set! (-> this first) (the-as uint 1)) ) ) - (let* ((a0-48 (the int (* 0.00024414062 (-> this root trans x)))) - (v1-37 (the int (* 0.00024414062 (-> this root trans y)))) - (a1-21 (the int (* 0.00024414062 (-> this root trans z)))) + (let* ((a0-48 (the int (/ (-> this root trans x) METER_LENGTH))) + (v1-37 (the int (/ (-> this root trans y) METER_LENGTH))) + (a1-21 (the int (/ (-> this root trans z) METER_LENGTH))) (a0-49 (- a0-48 *dice-offset-x*)) (a2-13 (- a1-21 *dice-offset-z*)) (a1-22 (+ a0-49 1)) @@ -1998,7 +1998,7 @@ (gp-0 (-> self draw shadow-ctrl)) ) (vector<-cspace! (-> self root trans) s5-0) - (let ((f0-1 (* 0.5 (-> s5-0 bone scale y)))) + (let ((f0-1 (/ (-> s5-0 bone scale y) 2))) (set-vector! (-> self root scale) f0-1 f0-1 f0-1 1.0) ) (cond @@ -2309,7 +2309,7 @@ ) ) (when (< f30-0 122880.0) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (* 0.000008138021 f30-0)))) (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (/ f30-0 (meters 30))))) (seconds 0.2)) (activate! *camera-smush-control* (lerp-scale 1638.4 0.0 f30-0 0.0 122880.0) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index bdf46fb666..0b1178872f 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -726,7 +726,7 @@ (the int (* 2.0 f30-0)) ) (else - (the int (* 0.5 f30-0)) + (the int (/ f30-0 2)) ) ) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc index b1bb81ca01..34f764aec3 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc @@ -638,7 +638,7 @@ (set! (-> self foot-locks s4-0 lock target) 1.0) ) (else - (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (* 0.000013563368 f1-2))) + (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (/ f1-2 (meters 18)))) (set! (-> self foot-locks s4-0 lock target) 0.0) ) ) @@ -987,7 +987,7 @@ (set! f28-0 0.0) ) (else - (* 0.5 f26-0) + (/ f26-0 2) ) ) ) @@ -1784,7 +1784,7 @@ (f30-0 (vector-normalize-ret-len! gp-1 1.0)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-1) - (set! (-> self root scale y) (* 0.000009042245 f30-0)) + (set! (-> self root scale y) (/ f30-0 (meters 27))) ) ) :code sleep-code @@ -1844,7 +1844,7 @@ (gp-2 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self target-pos))) ) (let ((f0-4 (vector-normalize-ret-len! gp-2 1.0))) - (set! (-> self root scale y) (* 0.000009042245 f0-4)) + (set! (-> self root scale y) (/ f0-4 (meters 27))) (vector+float*! (-> self root trans) s5-0 gp-2 (- f0-4)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-2) @@ -2005,7 +2005,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((f30-0 4096.0)) - (let ((f28-1 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f28-1 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (matrix->quaternion (-> self root quat) s5-0) (set-vector! (-> self root scale) f28-1 f28-1 f28-1 1.0) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index 062658fc74..561689360b 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -685,10 +685,10 @@ ) ) ((= (-> self stage) 3) - (* 0.004 f28-0) + (/ f28-0 250) ) (else - (* 0.008 f28-0) + (/ f28-0 125) ) ) ) @@ -1390,7 +1390,7 @@ ) ) (when (!= f30-0 0.0) - (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* 0.5 (-> self clock time-adjust-ratio) f30-0)) + (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* (/ (-> self clock time-adjust-ratio) 2) f30-0)) (matrix*! gp-0 gp-0 s5-0) (matrix-remove-z-rot gp-0 (new 'static 'vector :y -1.0)) (matrix->quaternion (-> self root quat) gp-0) @@ -1967,7 +1967,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (let ((f30-0 (* 4096.0 (* 0.25 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (* 4096.0 (/ (-> self clock time-adjust-ratio) 4))) (s1-0 #f) ) (set! (-> s3-0 quad) (-> self root trans quad)) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index f8169455bd..04f8a24471 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -409,7 +409,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index 9320778e18..8269d8a916 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -1064,13 +1064,13 @@ ) ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate ((this squid-tentacle) (arg0 int)) +(defmethod relocate ((this squid-tentacle) (offset int)) (dotimes (v1-0 11) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) - (&+! (-> this chain-joints v1-0 joint-mod) arg0) + (&+! (-> this chain-joints v1-0 joint-mod) offset) ) ) - (the-as squid-tentacle ((method-of-type process-drawable relocate) this arg0)) + (the-as squid-tentacle ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. @@ -1499,6 +1499,7 @@ ) (defmethod deactivate ((this squid)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this thruster-part)) (kill-and-free-particles (-> this thruster-part)) ) @@ -1519,39 +1520,39 @@ ) ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate ((this squid) (arg0 int)) +(defmethod relocate ((this squid) (offset int)) (if (nonzero? (-> this thruster-part)) - (&+! (-> this thruster-part) arg0) + (&+! (-> this thruster-part) offset) ) (if (nonzero? (-> this first-path)) - (&+! (-> this first-path) arg0) + (&+! (-> this first-path) offset) ) (if (nonzero? (-> this second-path)) - (&+! (-> this second-path) arg0) + (&+! (-> this second-path) offset) ) (if (nonzero? (-> this third-path)) - (&+! (-> this third-path) arg0) + (&+! (-> this third-path) offset) ) (if (nonzero? (-> this gun-tilt-left-jm)) - (&+! (-> this gun-tilt-left-jm) arg0) + (&+! (-> this gun-tilt-left-jm) offset) ) (if (nonzero? (-> this gun-tilt-right-jm)) - (&+! (-> this gun-tilt-right-jm) arg0) + (&+! (-> this gun-tilt-right-jm) offset) ) (if (nonzero? (-> this tentacle-base-jm)) - (&+! (-> this tentacle-base-jm) arg0) + (&+! (-> this tentacle-base-jm) offset) ) - (the-as squid ((method-of-type process-drawable relocate) this arg0)) + (the-as squid ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate @@ -2831,7 +2832,7 @@ This commonly includes things such as: (launch-particles (-> *part-id-table* 4859) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000012207031 f30-0)) + (f26-0 (/ f30-0 (meters 20))) (f30-1 (-> *part-id-table* 4860 init-specs 3 initial-valuef)) (f28-0 (-> *part-id-table* 4860 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index 1b5a1084c8..d59c05efd6 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -1441,7 +1441,7 @@ ) ) (set! (-> self gun-tilt) (fmin 8192.0 (fmax -8192.0 (-> self gun-tilt)))) - (let ((f30-2 (* 0.5 (-> self gun-tilt)))) + (let ((f30-2 (/ (-> self gun-tilt) 2))) (quaternion-set! (-> self gun-tilt-left-jm quat) (sin f30-2) 0.0 0.0 (cos f30-2)) ) (quaternion-copy! (-> self gun-tilt-right-jm quat) (-> self gun-tilt-left-jm quat)) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 961cde7a97..1ed3c3718f 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -140,7 +140,7 @@ (s1-0 (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> self root quat) - (+ (-> s4-0 z-rotate) (* 0.2 f28-0)) + (+ (-> s4-0 z-rotate) (/ f28-0 5)) ) ) ) @@ -189,25 +189,25 @@ ) ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate ((this pal-electric-fan) (arg0 int)) +(defmethod relocate ((this pal-electric-fan) (offset int)) (dotimes (v1-0 3) (dotimes (a2-0 6) (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) - (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) + (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) offset) ) ) ) - (the-as pal-electric-fan ((method-of-type process-drawable relocate) this arg0)) + (the-as pal-electric-fan ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -431,11 +431,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -545,7 +545,7 @@ This commonly includes things such as: (launch-particles (-> *part-id-table* 608) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f22-0 (* 0.000027126736 f30-0)) + (f22-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) (f26-1 (-> *part-id-table* 609 init-specs 1 initial-valuef)) @@ -891,6 +891,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this pal-rot-gun)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) (call-parent-method this) @@ -900,11 +901,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -965,11 +966,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1040,11 +1041,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/palace/throne/metalkor-texture.gc b/goal_src/jak2/levels/palace/throne/metalkor-texture.gc index 8737c9a431..c8088269b3 100644 --- a/goal_src/jak2/levels/palace/throne/metalkor-texture.gc +++ b/goal_src/jak2/levels/palace/throne/metalkor-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 67a91aff89..f26db2d6a6 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -193,7 +193,7 @@ ) ) ) - (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + (vector-float*! (-> s4-0 transv) s3-0 (/ (-> self clock frames-per-second) 10)) ) (let ((v1-35 (-> s4-0 root-prim))) (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) @@ -436,11 +436,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -511,11 +511,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index e8bcc676e0..e812934e45 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -63,7 +63,7 @@ (a0-8 (-> gp-1 mode)) (v1-6 (cond ((= a0-8 'mech-punch) - (and (< f1-1 0.0) (< (fabs (* 0.5 f0-3)) (fabs f1-1))) + (and (< f1-1 0.0) (< (fabs (/ f0-3 2)) (fabs f1-1))) ) ((= a0-8 'crush) (< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0) @@ -230,11 +230,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask collectable)) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index f09dbafcb0..f97d0ba881 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -240,7 +240,7 @@ (defmethod general-event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -465,10 +465,10 @@ (defmethod in-aggro-range? ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. -- if `activate-distance` is `0.0`, always true -- otherwise, check if the provided process is close enough -@param proc The process used to distance check -@returns true/false" + - if `activate-distance` is `0.0`, always true + - otherwise, check if the provided process is close enough + @param proc The process used to distance check + @returns true/false" (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) (and (t9-0 this arg0 arg1) (or (not (logtest? (-> this fact enemy-options) (enemy-option user8))) @@ -567,9 +567,9 @@ (defmethod common-post ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -823,7 +823,7 @@ (seek-to-point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-2) 3) - (* 0.5 (-> self nav max-rotation-rate)) + (/ (-> self nav max-rotation-rate) 2) (seconds 0.5) ) ) @@ -1411,11 +1411,11 @@ (none) ) -(defmethod relocate ((this rapid-gunner) (arg0 int)) +(defmethod relocate ((this rapid-gunner) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod init-enemy! ((this rapid-gunner)) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 03c16aed46..19455566f3 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -291,7 +291,7 @@ (f28-0 (seek-ease f0-8 0.0 - (* (lerp 21299.2 8192.0 (* 0.000005086263 (-> self spin-rate))) (seconds-per-frame)) + (* (lerp 21299.2 8192.0 (/ (-> self spin-rate) (meters 48))) (seconds-per-frame)) 12288.0 2.0 ) @@ -861,7 +861,8 @@ ) ) (cleanup-for-death self) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 6386b51660..23acec5162 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -589,7 +589,7 @@ ) (rigid-body-method-18 (-> v1-27 state) a1-12 a2-3) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 0 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 0 y))) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> this root quat)) (vector+! gp-0 gp-0 (-> this root trans)) (let ((v1-34 (-> this rbody)) @@ -606,7 +606,7 @@ ) (rigid-body-method-18 (-> v1-40 state) a1-21 a2-8) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 1 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 1 y))) ) ) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> this root quat)) @@ -1600,7 +1600,7 @@ (ja-no-eval :group! (-> self draw art-group data (-> self walk-anim)) :num! (loop!) :frame-num 0.0) (until #f (suspend) - (let ((f0-3 (fmax 0.2 (* 0.00008138021 (-> self observed-speed))))) + (let ((f0-3 (fmax 0.2 (/ (-> self observed-speed) (meters 3))))) (ja :num! (loop! f0-3)) ) ) @@ -2082,7 +2082,7 @@ ) (until #f (suspend) - (let ((f30-0 (fmax 0.2 (* 0.00008138021 (-> self observed-speed)))) + (let ((f30-0 (fmax 0.2 (/ (-> self observed-speed) (meters 3)))) (f28-0 0.0) ) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) diff --git a/goal_src/jak2/levels/tomb/widow-baron.gc b/goal_src/jak2/levels/tomb/widow-baron.gc index 9e4bbe7379..7756f75458 100644 --- a/goal_src/jak2/levels/tomb/widow-baron.gc +++ b/goal_src/jak2/levels/tomb/widow-baron.gc @@ -112,8 +112,8 @@ (defmethod init ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this timer) 0) (vector-reset! (-> this value)) 0 @@ -516,11 +516,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (case ((method-of-type res-lump get-property-struct) (-> this entity) 'tomb-boss-bridge-type diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index c82673045a..b5093678a2 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -591,21 +591,21 @@ ) (let ((s3-0 quaternion-set!) (s2-0 s5-0) - (s1-0 (sin (* 0.5 (-> this x-rotate)))) + (s1-0 (sin (/ (-> this x-rotate) 2))) (s0-0 0.0) ) (set! sv-48 (the-as float 0.0)) - (let ((t0-0 (cos (* 0.5 (-> this x-rotate))))) + (let ((t0-0 (cos (/ (-> this x-rotate) 2)))) (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) ) ) (let ((s3-1 quaternion-set!) (s2-1 gp-0) (s1-1 0.0) - (s0-1 (sin (* 0.5 (-> this y-rotate)))) + (s0-1 (sin (/ (-> this y-rotate) 2))) ) (set! sv-64 (the-as float 0.0)) - (let ((t0-1 (cos (* 0.5 (-> this y-rotate))))) + (let ((t0-1 (cos (/ (-> this y-rotate) 2)))) (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) ) ) @@ -1272,7 +1272,7 @@ (vector-! v1-42 arg1 arg0) (set! (-> v1-42 y) 0.0) (let ((f30-1 (atan (-> v1-42 x) (-> v1-42 z)))) - (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + (quaternion-set! (-> self root quat) 0.0 (sin (/ f30-1 2)) 0.0 (cos (/ f30-1 2))) ) ) (set! (-> self which-trajectory) 0) diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index 150a7ac430..2c7f94260d 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -787,7 +787,7 @@ (defmethod general-event-handler ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -931,7 +931,7 @@ (vector-normalize! s3-1 f28-0) (vector+! (-> this charge-pos) s5-0 s3-1) (let ((f30-0 f28-0) - (f28-1 (* 0.000024414063 f28-0)) + (f28-1 (/ f28-0 (meters 10))) (s3-2 0) (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1015,9 +1015,9 @@ (defmethod common-post ((this jellyfish)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this main-joint-acc) (-> this root quat))) ) (+! (-> this tentacle-clock) @@ -1146,16 +1146,17 @@ ) ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate ((this jellyfish) (arg0 int)) +(defmethod relocate ((this jellyfish) (offset int)) (dotimes (v1-0 5) (if (nonzero? (-> this tentacles v1-0)) - (&+! (-> this tentacles v1-0) arg0) + (&+! (-> this tentacles v1-0) offset) ) ) - (the-as jellyfish ((method-of-type hover-enemy relocate) this arg0)) + (the-as jellyfish ((method-of-type hover-enemy relocate) this offset)) ) (defmethod deactivate ((this jellyfish)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index 7412d52e3e..d1eaa84f2e 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -1318,7 +1318,7 @@ s5-1 ) (vector-normalize! s5-1 1.0) - (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (* 0.5 (-> self clock time-adjust-ratio)) 0.5) + (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (/ (-> self clock time-adjust-ratio) 2) 0.5) (vector-normalize! s5-1 1.0) (quaternion-from-two-vectors-partial! (-> self head-mod quat) diff --git a/goal_src/jak2/levels/under/underb-master.gc b/goal_src/jak2/levels/under/underb-master.gc index b167374587..2dd581dc1f 100644 --- a/goal_src/jak2/levels/under/underb-master.gc +++ b/goal_src/jak2/levels/under/underb-master.gc @@ -173,6 +173,7 @@ (define *underb-master* (the-as (pointer underb-master) #f)) (defmethod deactivate ((this underb-master)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this ambient-sound-id)) (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) @@ -620,14 +621,15 @@ ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate ((this under-locking) (arg0 int)) +(defmethod relocate ((this under-locking) (offset int)) (if (nonzero? (-> this draining-part)) - (&+! (-> this draining-part) arg0) + (&+! (-> this draining-part) offset) ) - (the-as under-locking ((method-of-type process-drawable relocate) this arg0)) + (the-as under-locking ((method-of-type process-drawable relocate) this offset)) ) (defmethod deactivate ((this under-locking)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this draining-part)) (kill-and-free-particles (-> this draining-part)) ) @@ -1039,11 +1041,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (set! (-> this which-reminder?) #f) (set! (-> this spooled-sound-id) (new 'static 'sound-id))