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
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=16235https://youtu.be/3V2GneLSY14?t=16619
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
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
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.
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>
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
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
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.
- `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.
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
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
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#4179Closes#4154
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
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
- 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
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)
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
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.
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>
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?`
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.
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.
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.
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
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.
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"
/>
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.
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>
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>
This adds more recognition for inlined vector functions to the
decompiler, which can clean up a bunch of ugly looking code/`rlet`s.

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>
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`).