169 Commits

Author SHA1 Message Date
Hat Kid 25e105aa5d jak2/3: implement ocean envmap (#4303)
Implements the envmap for the ocean generated by
`ocean-method-89`/`ocean-method-88`.

While the resulting envmap looks accurate compared to PCSX2 in
Renderdoc, the end result does not seem 100% identical, but it is a big
improvement over the default placeholder texture.

Closes #3417
2026-06-07 07:27:43 +02:00
Matt Dallmeyer b948e954d0 [jak2/3] Fix dark/light eco HUD not flashing after save file is X hours old (#4285)
Once `(-> *display* game-clock frame-counter)` gets too large, in the
HUD flashing math the `sin` function breaks down at high values. It's
effectively reading the number of ticks (times a multiplier) as degrees,
so we can modulo that by 360 to avoid breaking `sin`

This applies to both the eco meter and the dark jak icon in jak 2 - the
icon stops flashing twice as early because it's multiplied by x4 vs the
eco meter x2.

example:

you can see dark jak icon stops flashing around 2:36:02
https://youtu.be/3V2GneLSY14?t=9362

and dark eco meter stops flashing between 4:30 and 4:37
https://youtu.be/3V2GneLSY14?t=16235
https://youtu.be/3V2GneLSY14?t=16619
2026-06-06 17:32:12 +01:00
Hat Kid 580b190371 jak3: fix dark eco vent powerup anim (#4269)
Yet another case of the PS2 getting insanely lucky with buggy ND code,
the eco vents send an event to Jak to make him go into the powerup
state, but do not pass any event arguments which determine what
animation to play and at what speed/start frame. For the dark eco vents,
PS2 manages to somehow get the correct value of `7`, but we are not so
lucky.

As a side effect of this fix, we also get the originally intended
behavior for the light eco vents of playing the full powerup animation
from the start at a slower speed, rather than the much shorter one you
see on PS2.

Closes #4268
2026-05-06 04:29:15 +02:00
Hat Kid c4bc4d3ff4 jak3: fix region regression (#4264) 2026-05-04 21:47:47 +02:00
Nick0778 fea7d3a15d [jak3] Fix Daxter's death quotes scenes not playing (#4243)
This PR fixes a bug in `target-death.gc` that was causing Daxter's death
quotes scenes to not play in OpenGoal.

Basically, these scenes weren’t working because `sv-96` was assigned an
invalid level, and as a result the `s4-1` check always returned `#f`.
So, the `(when s4-1 ...)` block that contains the logic for these scenes
was never executed.

<img width="1118" height="911" alt="png1"
src="https://github.com/user-attachments/assets/b92505f0-fa9b-4499-a113-b7524265c314"
/>

## Before the fix:


https://github.com/user-attachments/assets/58e2f412-814b-40ff-ab64-d22054a7232e

## After the fix:


https://github.com/user-attachments/assets/bf6ac0da-1a62-4cb4-b363-20af898dac7f
2026-04-26 16:10:15 -04:00
Matt Dallmeyer a63cb1d212 [jak2/jak3] Fix off by one bug in trick display (#4224)
fixes #3150 

the scoring system counts up to 16 (point-scoring) tricks, but the
opengoal-secret display system was ignoring the 16th one, causing score
discrepancies
2026-04-19 00:47:36 +02:00
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00
Matt Dallmeyer 3e3542cb10 [jak3] Prevent NaN-induced infinite loop in ff-squad-control bubble sort (#4225)
This bit of ff-squad-control code is trying to sort guards based on
their distance from some shared target. In some cases the
`vector-vector-distance` returns NaN. In the bubble sort below this
change, the < operation always returns #t when NaN is involved, so the
NaN guard gets swapped back and forth endlessly, causing an infinite
loop.
2026-04-16 13:52:51 +01:00
Matt Dallmeyer 2f51e355dd [jak3] Implement trick display text secret (#4208)
ported the implementation from jak 2 into jak3 pretty much exactly.
added a new color for L2 tricks, and shrunk the text/width a bit so it
wouldn't end up covered by the minimap.

also fixed small bug in jak 2 (and 3) where dismounting jetboard
wouldn't reset the trick display, so displayed score wouldn't match the
granted score

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2026-04-14 01:40:27 -04:00
Hat Kid 7145890eee jak3: high fps fix for mech carry drop (#4223)
Closes #4205
2026-04-14 01:26:44 -04:00
Matt Dallmeyer 480fdaa282 [jak3] Fix some things relating to resetting speedruns (#4216)
addresses:
- starting new game from title screen with speedrun mode on -> shows
intro cutscene, doesn't start autosplitter, verification text not shown
- resetting run during intro cutscene leaves weird desert state across
training course (not an issue if we fix^)
- reset in hero mode after completing training course -> verification
text not shown
- resetting during tentacle grab leaves the water bubble sound playing
forever
2026-04-14 00:52:22 -04:00
Matt Dallmeyer d961e793ee [jak3] Make surround sound not the default (#4217) 2026-04-13 19:27:21 -04:00
Grateful Forest a18d74c6fd jak3: map fixes for pc port (#4199)
Three fixes for fullscreen map screens:

**1. Expand scanlines to cover whole screen**
Instead of just the 4:3 square, scales dynamically without overshooting.

**2. Fix map icon stretching**
On a real PS2, map icons squash incorrectly at 16:9, gets worse with
custom aspects. Fixed but preserves original game bug at PS2 16:9.

**3. Stop fast map scrolling at high FPS**
Same map scroll speed regardless of framerate.

Fixes #4195
2026-04-12 19:45:05 -04:00
Alex fedd27ebfd Adjust projectile focus fix to also work on semi-solid targets + fix tracking issues with dm-tentacles (#4207)
Fixes #4177 

Also additionally fixes the setting not doing anything to the
terraformer tentacles. Tentacles are no longer considered 'solid' when
dead while the setting is on.
2026-04-12 00:57:55 +01:00
Hat Kid cfe3ec9229 decomp3: cam-debug, hover-nav-edit, pilot-recorder (#4203)
Should be the last remaining files aside from `anim-tester` which we
already have a better replacement for.
2026-04-09 06:27:00 +02:00
Hat Kid 3f686854e6 decomp3: vivsol-edit, editable and nav mesh editor files (#4200)
- `visvol-edit`
- `editable`
- `editable-player`
- `mysql-nav-graph`
- `nav-graph-editor`
- `nav-mesh-editor-h`
- `nav-mesh-editor`

The SQL data is not filled in yet.
2026-04-08 17:42:13 +02:00
Tyler Wilding bd5bfe837b jak3: remove -debug from critical load-game logging function (#4187)
Closes #4183

Jak 2 didn't have this logging call so its fine, but jak 3 added this
which is a nice idea. TLDR - there's some settings we stopped loading
from the memcard as the source of truth, this function (`load-game...`)
skips said portions of the save file and in jak 3, includes a helpful
log message.

It constructed that log message by calling a `defun-debug` function,
which means that in retail mode, that function is gone, instead of that
being a straight forward crash, it returns garbage, which is passed to
`format`, which causes the crash. Fix is simple, make it a non-debug
function so it's always available.

Feels like something that could be improved about `goalc` but,
be-careful with debug only functions is the take away.

This would seem to impact any save file that wrote these related tags
(and thus, triggered the logging code) but it might also be semi-random
with how unlucky you get with the returned garbage addr
2026-04-06 01:10:49 -04:00
Matt Dallmeyer 147765fa23 [jak3] Update progress code to use DPROCESS_STACK_SIZE (#4186)
Mirroring [changes from
jak2](https://github.com/open-goal/jak-project/commit/ba12d804f7a6bed6e3c3dd7b6928bce5c02edb86#diff-a2dfc3363ae440ca32fdf57325fdbcd942fc0155877df70f12c447b9924d54a4),
this was actually causing crashes when opening Mission menu in modbase
2026-04-06 03:04:07 +02:00
Tyler Wilding c012005084 jak3: add unlock debug menu options (#4184)
Same as https://github.com/open-goal/jak-project/pull/3539
2026-04-05 18:18:17 -04:00
Tyler Wilding 1f1fdf834b jak3: support mirror mode (#4170)
Similar changes as have been done in the previous two games. Test the
following things:
- normal gameplay
- defend spargus turret
- satellite
- that desert mission where you shoot the gun
- that turret mission in haven forest

At a glance, i think that's everything...?

~~Didn't debug the crash yet either, hoping this is sufficient~~ (fixed,
thanks hatkid, needed to disable some blit related code)

Closes #4160
2026-04-05 17:52:15 -04:00
Hat Kid dc203502fc jak3: fix potential wascity-defend softlock, stick sens setting, fix freeze-screen regression (#4182)
There was some bad manual decomp in `wasdef-manager` that caused the
mission to sometimes softlock, preventing Jak from exiting the turret
after destroying all Makers.

Also adds stick sensitivity setting from Jak 2 and fixes a regression
with the Light Jak freeze screen overlay on PC aspect ratios.

Closes #4179 
Closes #4154
2026-04-05 16:58:19 +02:00
Tyler Wilding c3cc91c9ba jak2/3: update enemy method name related to playing sound effects (#4176)
Was investigating https://github.com/open-goal/jak-project/issues/3012
and found out it's no longer an issue, fixed at some point.

Updated the method name, it actually looks like quite a few methods were
nicely named / documented in jak 3, so i might automate backporting that
documentation (likely a bunch that can go all the way back to jak 1 as
well).

Closes #3012
2026-04-05 01:14:14 -04:00
Matt Dallmeyer fe8a664f52 [jak3] Support PC camera invert options (#4171)
Implement PC camera inversion toggles, for first/third
vertical/horizontal controls

Reuses vanilla placement of Camera Options menu (as opposed to under
Input Options like jak1/2)

fixes #4158
2026-04-04 08:26:36 +02:00
Hat Kid 6de4b0e62c jak3: misc rpc and progress fixes (#4159)
- Fixed font scaling for main menu options and auto save info box
- Removed surround sound option (we probably won't be implementing this
any time soon)

Discord RPC fixes/additions:
- Now shows what gun you currently have out
- Fixed outdoor levels not showing their icons
- Added icons for vehicles and various other states
- Fixed glider mission not displaying
2026-04-03 03:27:53 +02:00
Matt Dallmeyer be18834432 [jak3] Port over R1/R2 swap and trigger effects from jak2 (#4151)
Exact same changes as jak 2, except I have the left trigger effect moved
from `target-darkjak-get-on` to `target-powerjak-get-on` (the crouching
state before he goes to dark or light jak)
2026-04-03 03:20:51 +02:00
Matt Dallmeyer 3c985f8c3a [jak2/jak3] Unbreak split boxes debug option (#4133)
The `Split Boxes` option in jak2/3 currently crashes as soon as you
select it because of the `*debug-region-hide-empty*` code added in
openGOAL. The split boxes aren't true regions, but they reuse the
`debug-draw-region` functions, and crash trying to access `(-> this
region on-enter)`.

<img width="2160" height="1620" alt="image"
src="https://github.com/user-attachments/assets/e8753fcc-8234-40fa-9278-d2dca4dff71a"
/>
yay split boxes
2026-03-17 22:07:15 -04:00
Matt Dallmeyer ad3e55745a [jak2/jak3] Wait to reset autosplitter until after blackout (#4126)
Based on [similar changes we made awhile back for
jak1](https://github.com/open-goal/jak-project/pull/3902) - this way
runners don't need to figure out the -0.3s offset or whatever, and it
won't vary based on where they reset from.
2026-02-28 21:07:12 -05:00
Aloqas f4512a41dd Jak 3 Finnish translation + Update Jak 1 & 2 translations (#4028)
Massive overhaul of Finnish translations

I guess it's time to finally push this out

I'll go insane if I have to proofread one more time :P
Every time I just realize my translations sucked and I keep tweaking
everything

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2025-12-28 15:12:26 -05:00
Matt Dallmeyer 04f1f93bec [jak2/3] Fix same-attack-invulnerable-timeout clock drift original game bug (#3978)
So `target` has some logic here which checks if the pending attack has
the same ID as the last attack, and if so it checks for a 2s grace
period `(-> *TARGET-bank* same-attack-invulnerable-timeout)` before the
attack will actually count:

https://github.com/open-goal/jak-project/blob/7320bfc068acfa385f929b176f61caf3b7aabbbe/goal_src/jak3/engine/target/target-util.gc#L1664-L1674

This `same-attack-invulnerable-timeout` check uses `time-elapsed?`,
which under the hood references `(current-time)` AKA `(-> PP clock
frame-counter)`, which makes sense.

However the code that actually stores the `attack-time` uses a different
clock `(-> *display* base-clock frame-counter)`:

https://github.com/open-goal/jak-project/blob/7320bfc068acfa385f929b176f61caf3b7aabbbe/goal_src/jak3/engine/target/target-util.gc#L1765-L1768

So if these two clocks get out of sync - say the `target` process clock
falls behind the `*display*` clock - then we can end up storing an
`attack-time` that's "in the future" from `target`'s perspective,
effectively increasing the `same-attack-invulnerable-timeout`.

This clock drift can happen in real gameplay - Usual today was having it
happen consistently with the route he was attempting for NoOOB. I was
able to reproduce it consistently in OpenGOAL as well:
- get "invuln 2" (i.e. you have `(target-flags disable-attacks)` but not
`(focus-status dead ignore)`)
- restart mission at the top of temple before the glider mission trigger
- immediately go into the trigger and fall off the cliff (during the
black screen)
- you'll get the glider cutscene, but should respawn back at the bottom
of temple

Somewhere in this^ cutscene/blackout, the two clocks drift apart -
presumably `target`'s clock is paused but the other is not. Later in the
speedrun, this causes the extra long invuln timeout bug, which wastes
time while trying to intentionally lower health.

https://www.youtube.com/watch?v=WD2MLj8ccfg

As far as I can tell, any other code interacting with `attack-time` also
uses `(current-time)` or one of the wrapping macros like `set-time!` or
`time-elapsed?`
2025-12-27 22:38:33 -05:00
water111 75b4af4695 [jak3] PC uploads for water textures (#4097)
This is needed for the precursor bot sword trail texture, which is in
the water tpage
2025-12-08 19:45:44 -05:00
water111 4dee142336 [jak3] Fix rigid-body threshold to account for frame time (#4095)
Very similar to https://github.com/open-goal/jak-project/pull/4068, but
adjusts the scale based on the process clock. I think this approach is a
little bit better since it shouldn't depend on frame timing at all.
2025-12-08 19:33:09 -05:00
water111 11c35a05ca [jak3] Add slow-time blur and fix color filter (#4037)
This implements the blur effect when time is slow and fixes some issues
with the color filter. Previously the color filter didn't work if the
multiplier was > 1.


https://github.com/user-attachments/assets/7198d2ff-98cb-4708-9ef7-800edc0bacf6
2025-12-08 18:20:58 -05:00
Matt Dallmeyer 512696b625 [jak3] Support dpad pacman controls (#4083)
Not sure if we really want this change in vanilla openGOAL, but I had it
working on a branch so figured I'd PR it.
2025-12-08 17:43:04 -05:00
water111 5681aa64a5 Fix generic2 zbuffer and jak3 progress menu crash (#4091)
Fix Generic2 bug where a tricky way to disable z-buffer writing wasn't
being detected. This should fix some lightning or other effects:
<img width="968" height="982" alt="image"
src="https://github.com/user-attachments/assets/cf3225c1-9ea4-45ed-86e3-2ad3b9a6b1ee"
/>


Also fixed an original game issue(?) where a hud box could be used
uninitialized . Sometimes this would end up drawing a really large box
area which would overflow the DMA buffer and cause confusing crashes.
2025-12-07 22:18:51 -05:00
Matt Dallmeyer 2e7bbf2110 [jak3] Implement city-peace and desert-peace cheats (#4079)
https://www.youtube.com/watch?v=VrEfiMFvUKU
2025-11-20 16:27:01 +01:00
Hat Kid 0385c76811 decomp: support part-tracker-spawn in jak2, part group constants (#4082) 2025-11-20 16:22:29 +01:00
Alex 08650e1e4c Fix strange scene-player initial blackout being bad for non-zero artist-base (#4056)
This fixes the metal head tower resolution cutscene having an awkward
amount of blackout at the start unless the framerate dipped to at least
(most?) 33FPS, since its frame num starts in the negative. There may be
other cutscenes that start at negative or higher than zero, but I don't
know of any (did not check thoroughly as that's boring as hell).

I don't really understand what the purpose of this check is in the first
place to be honest.
2025-10-17 20:45:03 +01:00
Hat Kid 73dd982fdc jak3: misc high fps fixes (#4055)
Fixes for:

- `prebot` sword attack and projectile speed (fixes #4050)
- Fast first person camera turning speed (fixes #4051)
- Slow turret camera turning speed (fixes #4052)
- `flyingsaw` movement and rotation speed (fixes #4053)
- Green eco drain rate on jetboard during `forest-kill-plants` mission
(fixes #4054)
- `skeet` rotation speed
- `maker-grenade` tumble speed
- Jetboard spin speed
- `hud-skill` rotation speed (also for jak2)
- `gun-dark-shot` projectile speed (also for jak2)
- `target-float` up/down speed (also for jak2)
- Texscroll speed
- Slow walk anim after landing from a jump
2025-10-17 14:28:22 +02:00
Alex 3f75e5d504 Add support for brightness and contrast modifiers (#4041) 2025-10-07 21:53:16 +01:00
Alex 48903fc6f8 [jak3] fix stereo vag commands causing memory corruption (#4040)
All stereo VAG commands would write to an out-of-bounds array element
and corrupt the whole VAG queue list.

Fixes random sound-related crashes including a consistent Light Jak
Freeze crash.
2025-10-07 01:34:51 +01:00
Alex 701624bbf5 [jak3] fix soundless spools always assuming 60fps + [jak2] fix rogue entity error spam on ctywide kill (#4038) 2025-10-06 23:46:08 +01:00
water111 2cd64522c4 [jak3] fix bomb and war factory ocean culling (#4036)
Fix textures on the bomb (just a simple typo fix):
<img width="1638" height="1067" alt="2025-10-05_18-22"
src="https://github.com/user-attachments/assets/d31fedd4-b4f3-4e65-8457-a67068b137be"
/>

Fix issue with ocean culling when in the war factory. In this level, the
make the background rotate by defining a different camera matrix. We
need to use that matrix when culling the ocean, since it rotates too.
This is different on PC because the original game stashed the camera
frustum planes in some vf registers for background drawing.

<img width="1638" height="671" alt="image"
src="https://github.com/user-attachments/assets/feb5f931-e71f-411e-8a29-e8d970f70078"
/>
2025-10-05 19:37:05 -04:00
water111 c8a1643e9f [jak3] Add zoom blur and color filter effect (#4031)
Add the zoom blur effect, used by cutscene effects and a few weapons:


https://github.com/user-attachments/assets/8d231b34-faf8-4b88-a636-edf2b5477ff9

And color filtering


https://github.com/user-attachments/assets/67db5933-4b29-4c77-ad56-5025cbefa328

There's still two blit-displays not covered: scanlines and the light jak
slow motion effect.
2025-10-04 17:06:18 -04:00
Tyler Wilding a0a4ec7df5 game: fix level select for untranslated languages and fix infinite recursion edge-case in lookup-text! (#3969)
The main bug this fixes is not being able to use level select when your
language isn't translated. Why? Because they use the result from
`lookup-text!` to determine if a menu item should be drawn or not. No
text found, no menu item.

However this uncovered a long-standing bug in my fallback extension to
this code. If you call this function with a text-id that doesnt even
have an english string, it will recursively keep calling itself until it
crashes. Of course the first few tasks in the game are dummies and have
no valid text-id so this had to be fixed.

Should be fixed for all 3 games.
2025-07-02 22:44:02 -04:00
SuperSamus 5522c3d500 [high fps] fix blinking in all games (#3759)
Fixes both interval and animation speed. (jak1 previously only had a fix
for the former.)
This should close #3518, and one of the issues of #1499.

The solution is not the cleanest. The results are going to be wrong in
case the FPS doesn't reach the maximum set.
A better solution would be to make `random-time` a float, so that it can
be subtracted by `time-adjust-ratio`, but I don't know if changing a
type for this purpose is allowed here. Tell me if I should do that
instead.

Tested only on jak2.

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2025-06-01 18:50:33 -04:00
Hat Kid c61a69d751 jak3: wip pc progress code (#3898) 2025-04-16 20:57:43 +02:00
water111 23118be428 [jak3] Fix crash in subrails (#3863)
After the change to vector ops, subrails was crashing. This fixes the
crash by fixing a stack type and also marks those new vector op
functions as inline.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-16 17:40:23 -05:00
water111 2a4d3d7a4a [decompiler] More inline vector functions (#3861)
This adds more recognition for inlined vector functions to the
decompiler, which can clean up a bunch of ugly looking code/`rlet`s.


![image](https://github.com/user-attachments/assets/1f7b4627-81bd-481b-b828-76b9f7ba13b3)

Unfortunately, this changes the numbering of ops in the decomp, since
all the vector instructions get combined in a single "operation" by the
decompiler. I really tried to avoid having this ever happen in the
decompiler and this is one of the few cases where it has. So I had to
update a bunch of type casts.

For that reason I haven't turned this on in Jak 2 yet, although I am
planning to do that at some point. (probably at the same time as porting
back a bunch of jak 3 improvements to jak 2)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-16 15:59:17 -05:00
water111 48cb9bb787 [decompiler] as-type and font method support (#3855)
Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-01 21:23:11 -05:00
Hat Kid 710f3ac117 custom levels: etie and build actor support for jak2/3 (#3851)
Custom levels for Jak 2/3 now support envmapped TIE geometry. The TIE
extract was also changed to ignore materials that have the specular flag
set, but are missing a roughness texture.

Jak 2/3 now also support the `build-actor` tool.

The `build-custom-level` and `build-actor` macros now have a few new
options:

- Both now have a `force-run` option (`#f` by default) that, when set to
`#t`, will always run level/art group generation even if the output
files are up to date.
- `build-custom-level` has a `gen-fr3` option (`#t` by default) that,
when set to `#f`, will skip generating the FR3 file for the custom level
and only generate the GOAL level file to skip the potentially slow
process of finding and adding art groups and textures. Useful for when
you want to temporarily edit only the GOAL side of the level (such as
entity placement, etc.).
- `build-actor` has a `texture-bucket` option (default 0) which will
determine what DMA sink group the model will be placed in, which is
useful to determine the draw order of the model. Previously, this was
omitted, resulting in shadows not drawing over custom actors because the
actors were put in a bucket that is drawn after shadows (this behavior
can be restored with `:texture-bucket #f`).
2025-02-01 18:04:26 +01:00