Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ad5496c
initial global countdown
MikeGamePro Jul 11, 2026
3d6c8f4
rule/complication base
MikeGamePro Jul 12, 2026
95210ff
Expand mod rules with counters and punishments
MikeGamePro Jul 12, 2026
7aa9381
ohko, buffer, tweak timers
MikeGamePro Jul 12, 2026
184ab1c
re-color, re-name, water and edge jumps
MikeGamePro Jul 12, 2026
ab1876b
large text, redead, orbs add 1 sec
MikeGamePro Jul 12, 2026
1e2fbf5
rewording, warp punish fix, reformatting
MikeGamePro Jul 12, 2026
8005133
weighted rolls, last breath, event-once
MikeGamePro Jul 13, 2026
8325463
deciseconds, more robust weightings
MikeGamePro Jul 13, 2026
e2b727b
Update mod-common-functions.gc
MikeGamePro Jul 13, 2026
6d7e857
fix geyser warp, finish redead
MikeGamePro Jul 13, 2026
d1036cb
sfx, improve punishment filter,
MikeGamePro Jul 13, 2026
5bb1344
heating balloons and more rule filtering
MikeGamePro Jul 13, 2026
a105fde
lurker/crate rules, jump cleanup w/ flut and racer, mean look
MikeGamePro Jul 13, 2026
2875a87
fix rule-die filter, zoomer and racer deaths
MikeGamePro Jul 13, 2026
7bd601d
Update racer-states.gc
MikeGamePro Jul 13, 2026
c14548e
fix plant boss and robber deaths + more rule filters (jungleb)
MikeGamePro Jul 13, 2026
959737b
add extra rule back
MikeGamePro Jul 13, 2026
8be01fd
reroll on timer end
MikeGamePro Jul 13, 2026
86d4d60
flop only, disassociate, klaww death, racer/flut check
MikeGamePro Jul 14, 2026
5b69570
money and fuel tracking + more filtering
MikeGamePro Jul 14, 2026
e54afba
timed punishments
MikeGamePro Jul 14, 2026
8a05cd3
trip punishment + knuth-rand
MikeGamePro Jul 14, 2026
010c54a
bus driver + filter cleanup
MikeGamePro Jul 14, 2026
90f260d
buzzer beater, flut no cell, fix flut death, rats check
MikeGamePro Jul 14, 2026
5b8bd00
stay alive, flut flop fix, ohko expiry heal
MikeGamePro Jul 15, 2026
e96b3f6
fuel shortage (real), renames, more filter adjustments, debug btn combos
MikeGamePro Jul 15, 2026
4e44f84
anger mgmt, like a stone, small helper cleanup
MikeGamePro Jul 15, 2026
0ec52ad
jak rabbit, hidden treasure, deactivation fix, quicksand-lurker
MikeGamePro Jul 15, 2026
c0a4b4a
5 new rules, lurker/buzzer pressure changes
MikeGamePro Jul 16, 2026
065b45a
hidden-treasure refresh, buzzer dist visual, crate break amount pass,…
MikeGamePro Jul 16, 2026
2591d22
bleh
MikeGamePro Jul 16, 2026
23d2a18
fuel pickup fix, grace period, buzzer notice-blue, flies add 5, other…
MikeGamePro Jul 16, 2026
d4e6d3a
lotta value and priority changes, fixed buzzer-left still being at 1
MikeGamePro Jul 16, 2026
4df4e77
renames and rule result on multiple slots
MikeGamePro Jul 17, 2026
3cc71c8
global timer on save file
MikeGamePro Jul 17, 2026
b7cbbb1
Update .gitignore
MikeGamePro Jul 17, 2026
63f53ce
Update mod-common-functions.gc
MikeGamePro Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,4 @@ out/jak2/fr3.rar
goalc-report.html
.vscode/PythonImportHelper-v2-Completion.json
_new-all-types.gc
goal_src/jak1/engine/mods/mod-common-functions.txt
14 changes: 14 additions & 0 deletions .vs/launch.vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@
"-fakeiso",
"-debug"
]
},
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "gk.exe (bin\\gk.exe)",
"name": "Game - Jak 1 - Runtime (release)",
"args": [
"-v",
"--game",
"jak1",
"--",
"-boot",
"-fakeiso"
]
},
{
"type": "default",
Expand Down
15 changes: 15 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**why the hell do enemies randomly despawn**

(mod-rules-reset) on game exit
improve game over state
finish drought (disable water draw)
alert sound on last 10 seconds, find a replacement for new rule
look at orb refresh on hidden treasure again

flut can still grab fly cells during wings tied

maybe rename: crate break, keep it low, one frame
maybe add checks for green eco lurkers
maybe add settings for timer placement
consider replacement for jak rabbit
maybe improve all other sounds
45 changes: 32 additions & 13 deletions goal_src/jak1/engine/common-obs/collectables.gc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

(define-extern orb-placer-list-maintenace (function symbol none))

(define-extern target-on-flut? (function symbol))

(define-extern mod-rule-active? (function symbol symbol))

(declare-type vent process-drawable)

(declare-type eco eco-collectable)
Expand Down Expand Up @@ -699,6 +703,10 @@
:code
(behavior ()
(loop
(if (mod-rule-active? 'complication-hidden-treasure)
(set! (-> self draw status) (draw-status hidden))
(set! (-> self draw status) (draw-status)))

(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame)))
(let ((f30-0 (-> self bob-amount)))
(when (< 0.0 f30-0)
Expand All @@ -707,10 +715,12 @@
(-> self suck-y-offset)
(* f30-0 (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))))))
(update-transforms! (-> self root))))
(ja-post)
;; og:preserve-this added particle!
(with-pc
(if (-> *pc-settings* money-starburst?) (spawn (-> self part) (-> self root root-prim world-sphere))))

(when (!= (-> self draw status) (draw-status hidden))
(ja-post)
(with-pc
(if (-> *pc-settings* money-starburst?) (spawn (-> self part) (-> self root root-prim world-sphere)))))

(suspend))))

(defstate notice-blue (money)
Expand Down Expand Up @@ -894,18 +904,19 @@
:event
(behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(when (and (or (= message 'touch) (= message 'attack))
(and (logtest? (-> self flags) (collectable-flags can-collect))
(time-elapsed? (-> self birth-time) (-> self collect-timeout))
(and (not (handle->process (-> *game-info* other-camera-handle)))
(not *progress-process*)
(!= (-> self next-state name) 'pickup)
*target*
(not (logtest? (-> *target* state-flags) (state-flags grabbed dying))))))
(when (and (not (mod-rule-active? 'complication-fuel-shortage))
(or (= message 'touch) (= message 'attack))
(and (logtest? (-> self flags) (collectable-flags can-collect))
(time-elapsed? (-> self birth-time) (-> self collect-timeout))
(and (not (handle->process (-> *game-info* other-camera-handle)))
(not *progress-process*)
(!= (-> self next-state name) 'pickup)
*target*
(not (logtest? (-> *target* state-flags) (state-flags grabbed dying))))))
(add-setting! 'allow-progress #f 0.0 0)
(apply-settings *setting-control*)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle proc)))
(if (not (and (target-on-flut?) (mod-rule-active? 'complication-wings-tied))) (go-virtual pickup #f (process->handle proc))))
(cond
((= message 'trans)
(set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad))
Expand Down Expand Up @@ -934,6 +945,13 @@
(let ((f28-0 0.0))
(ja :group! fuel-cell-idle-ja)
(loop
(if (not (mod-rule-active? 'complication-fuel-shortage))
(begin
(logclear! (-> self draw status) (draw-status hidden))
(restore-collide-with-as (-> self root)))
(begin
(logior! (-> self draw status) (draw-status hidden))
(clear-collide-with-as (-> self root))))
(let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0))))
(set! f28-0
(if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim))))
Expand Down Expand Up @@ -1013,6 +1031,7 @@
(move-to-ground (-> self root) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background)))))
(spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0))
(send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount))
(runs-on-cell-pickup 'pickup)
(set! (-> self draw bounds w) 32768.0)
(logior! (-> self skel status) (janim-status inited))
(send-event *target* 'blend-shape #t)
Expand Down
37 changes: 31 additions & 6 deletions goal_src/jak1/engine/common-obs/crates.gc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
(in-package goal)
(bundles "ENGINE.CGO" "GAME.CGO")
(require "engine/common-obs/collectables.gc")

(define-extern runs-on-crate-break (function process-drawable symbol int none))

(declare-type crate process-drawable)

(declare-type crate-buzzer crate)

;; DECOMP BEGINS

(define-extern *buzzer-dist-tracker* (float))
(define-extern *closest-buzzer-dist* (float))
(define-extern mod-rule-trigger-blue-crate (function none))

(defskelgroup *crate-barrel-sg*
crate
crate-barrel-lod0-jg
Expand Down Expand Up @@ -562,6 +569,14 @@
:event crate-standard-event-handler
:trans
(behavior ()
(when (and *target* (type-type? (-> self type) crate-buzzer))
(let ((current-frame (-> *display* base-frame-counter)))
(when (!= *closest-buzzer-frame* current-frame)
(set! *closest-buzzer-frame* current-frame)
(set! *closest-buzzer-dist* 1000000000.0))
(let ((current-dist (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(when (< current-dist *closest-buzzer-dist*)
(set! *closest-buzzer-dist* current-dist)))))
(cond
((not (send-event *target* 'query 'powerup (pickup-type eco-blue)))
(logior! (-> self mask) (process-mask sleep-code))
Expand All @@ -582,6 +597,7 @@
(f30-0 (vector-vector-distance (-> gp-2 world-sphere) (-> a1-3 world-sphere))))
(when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel))
(logior! (-> self fact options) (fact-options can-collect))
(mod-rule-trigger-blue-crate)
(go-virtual die #f 0))
(when (rand-vu-percent? 0.5)
(let ((s5-0 (new 'stack-no-clear 'vector)))
Expand Down Expand Up @@ -638,6 +654,7 @@
(logior! (-> self fact options) (fact-options instant-collect)))
(when (not arg0)
(suspend-for (seconds 0.04))
(runs-on-crate-break self 'break 1)
(logior! (-> self draw status) (draw-status hidden))
(case (-> self look)
(('iron) (sound-play "icrate-break"))
Expand Down Expand Up @@ -929,12 +946,20 @@
:virtual #t
:trans
(behavior ()
(when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(time-elapsed? (-> self state-time) (seconds 1.5))
(rand-vu-percent? 0.03))
(spawn (-> self part) (-> self root trans))
(activate! (-> self smush) 0.2 90 150 1.0 1.0)
(logclear! (-> self mask) (process-mask sleep-code)))
(when *target*
(let ((current-frame (-> *display* base-frame-counter)))
(when (!= *closest-buzzer-frame* current-frame)
(set! *closest-buzzer-frame* current-frame)
(set! *closest-buzzer-dist* 1000000000.0))
(let ((current-dist (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(when (< current-dist *closest-buzzer-dist*)
(set! *closest-buzzer-dist* current-dist))
(when (and (>= 327680.0 current-dist)
(time-elapsed? (-> self state-time) (seconds 1.5))
(rand-vu-percent? 0.03))
(spawn (-> self part) (-> self root trans))
(activate! (-> self smush) 0.2 90 150 1.0 1.0)
(logclear! (-> self mask) (process-mask sleep-code))))))
(if (nonzero? (-> self sound)) (update! (-> self sound)))
(if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0)))
:code
Expand Down
6 changes: 5 additions & 1 deletion goal_src/jak1/engine/common-obs/nav-enemy.gc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

;; DECOMP BEGINS

(define-extern mod-rule-trigger-mean-look (function none))
(define-extern notify-enemy-death (function process-drawable none))

(defun nav-enemy-rnd-float ()
(rand-vu))

Expand Down Expand Up @@ -540,7 +543,7 @@ nav-enemy-default-event-handler
(vector-vector-distance (-> self collide-info trans) (-> *target* control trans))))
(let ((gp-0 'racer)) (= gp-0 (send-event *target* 'query 'mode)))))
(go-virtual nav-enemy-flee))
(if (nav-enemy-notice-player?) (go-virtual nav-enemy-notice))))
(when (nav-enemy-notice-player?) (mod-rule-trigger-mean-look) (go-virtual nav-enemy-notice))))
:code
(behavior ()
(let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)))
Expand Down Expand Up @@ -809,6 +812,7 @@ nav-enemy-default-event-handler
:event process-drawable-death-event-handler
:enter
(behavior ()
(notify-enemy-death self)
(send-event (ppointer->process (-> self parent)) 'child-die))
:code
(behavior ()
Expand Down
6 changes: 6 additions & 0 deletions goal_src/jak1/engine/common-obs/process-drawable.gc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

;; DECOMP BEGINS

(define-extern runs-on-enemy-death (function process-drawable none))

(defun notify-enemy-death ((enemy process-drawable))
(runs-on-enemy-death enemy)
(none))

(defun cspace-by-name ((arg0 process-drawable) (arg1 string))
(let* ((s4-0 (-> arg0 node-list length))
(s3-0 0)
Expand Down
11 changes: 9 additions & 2 deletions goal_src/jak1/engine/common-obs/water.gc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

;; DECOMP BEGINS

(define-extern mod-rule-active? (function symbol symbol))

(defpart 108
:init-specs
((:texture (water-ring effects))
Expand Down Expand Up @@ -988,13 +990,18 @@
:event
(behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('update) (update! self))))
(('update)
(if (not (mod-rule-active? 'complication-drought))
(update! self)
(on-exit-water self)))))
:exit
(behavior ()
(on-exit-water self))
:trans
(behavior ()
(update! self))
(if (not (mod-rule-active? 'complication-drought))
(update! self)
(on-exit-water self)))
:code anim-loop)

(defmethod set-stack-size! ((this water-vol))
Expand Down
6 changes: 3 additions & 3 deletions goal_src/jak1/engine/entity/entity.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,9 @@
(set! (-> arg0 root trans quad) (-> arg1 extra trans quad))
(quaternion-copy! (-> arg0 root quat) (-> arg1 quat))
(vector-identity! (-> arg0 root scale))
(let ((scale (res-lump-struct arg1 'scale vector)))
(when scale
(set-vector! (-> arg0 root scale) (-> scale x) (-> scale y) (-> scale z) 1.0)))
;; (let ((scale (res-lump-struct arg1 'scale vector)))
;; (when scale
;; (set-vector! (-> arg0 root scale) (-> scale x) (-> scale y) (-> scale z) 1.0)))
(none))

(defmethod update-perm! ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status))
Expand Down
21 changes: 18 additions & 3 deletions goal_src/jak1/engine/game/game-save.gc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

(define-extern mark-speedrun-started (function none))

;; mod: hooks for persisting the global countdown timer in the save file.
;; implemented in mod-common-functions.gc
(define-extern global-countdown-save-value (function int))
(define-extern global-countdown-resume-from-save (function int none))

;; version identifier
(defconstant SAVE_VERSION 1)

Expand Down Expand Up @@ -92,7 +97,8 @@
(vibration 506)
(play-hints 507)
(video-mode 508)
(aspect-ratio 509))
(aspect-ratio 509)
(mod-global-timer 510))

;; DECOMP BEGINS

Expand Down Expand Up @@ -578,7 +584,14 @@
((= a1-125 'aspect4x3) 1)
((= a1-125 'aspect16x9) 2)
(else 0)))))
(set! (-> arg0 length) (&- (&+ v1-112 16) (the-as uint (the-as pointer (-> arg0 tag))))))))))))))))))))))))))))))))))))))))))))))))))))))))
;; mod: persist the global countdown timer as one more tag
(let ((v1-113 (&+ v1-112 16)))
(let ((a0-89 (the-as game-save-tag (&+ v1-113 0))))
(set! (-> a0-89 elt-type) (game-save-elt mod-global-timer))
(set! (-> a0-89 elt-count) 0)
(set! (-> a0-89 user-uint64)
(the-as uint (global-countdown-save-value))))
(set! (-> arg0 length) (&- (&+ v1-113 16) (the-as uint (the-as pointer (-> arg0 tag)))))))))))))))))))))))))))))))))))))))))))))))))))))))))
(if (< (-> arg0 allocated-length) (-> arg0 length))
(format 0 "ERROR: SAVEGAME: fatal error, save is using ~D of ~D bytes." (-> arg0 length) (-> arg0 allocated-length)))
(none))
Expand Down Expand Up @@ -709,7 +722,9 @@
(let ((v1-92 (min 32 (-> data elt-count))))
(dotimes (a0-133 v1-92)
(set! (-> this fuel-cell-time a0-133)
(the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-133 8))))))))))
(the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-133 8)))))))))
(((game-save-elt mod-global-timer))
(global-countdown-resume-from-save (the-as int (-> data user-uint64)))))
(set! data
(the-as game-save-tag
(&+ (the-as pointer data) (logand -16 (+ (* (the-as int (-> data elt-size)) (-> data elt-count)) 31)))))))
Expand Down
Loading