Commit Graph

1405 Commits

Author SHA1 Message Date
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
Grateful Forest abef970f58
jak2: fix hud alignment (#4075)
There were a few things going on here.

Jak 2's menu wheel is zoomed in at 16:9 but zoomed out at 4:3. However,
the custom aspects use the scaling from the 4:3 mode, this makes sense
as you'd want the zoomed out wheel.

However I noticed HUD elements scaled correctly on PS2 16:9 but not PC
16:9, which was a hint.

The hardcoded values for every individual HUD element for 16:9 and 4:3
are in pixels, normalized across 480 being the stretch of the screen.

To fix the HUD alignment I scaled those offsets, scaling them inside
`set-hud-piece-position` meant both textures and merc models got scaled
at the same time.

Note that you can get (very tiny) snapping into different integer values
as you scale to different aspects. This is simply the result of scaling
integer offsets which is what the game uses.

<img width="1704" height="639" alt="2"
src="https://github.com/user-attachments/assets/81e75f7c-04ba-4c9a-8a50-215d13bd4089"
/>
2025-12-08 19:33:01 -05:00
Grateful Forest aed61ce70c
jak1: fix opening logo on non-PS2 aspects (#4073)
There are two issues here:

1 is the "punch in" where the logo punches inwards towards the camera on
first appearance, this effect reveals the edges of village1
significantly and happens for all users even on regular 16:9.

2 is on aspect ratios wider than 16:9, you see even larger areas of
village1 on either side.

The blackout is an artgroup that breaks apart and is set to the shape of
the Jak 1 logo. It has a baked in animation and is a set size, so it
cannot simply be scaled or adjusted to be wider.

Seeing the sides of village1 before seeing the logo is not the immersive
experience this opening was going for, where the game "bursts" into the
screen.

My first thought to fix was to simply call `set-letterbox-frames` until
the right moment. This worked, however, it didn't produce an ideal
result simply because the letterbox also went on top of the light blue
"logo volumes" starburst.

Having experimented with the range of edits possible here, I decided the
best approach is actually to simply delay displaying village1 ever so
slightly. This avoids editing the very particular blackout art group,
with set sizes of chunks that break apart. This also avoids covering the
blue volumes with a side letterbox/covering.

This scales with any aspect, supports both different language logo
blackout shapes, and fixes both wide aspect issues as well as the
regular 16:9 punch in issue. This is an important edit as it's the first
thing people see.

<video controls
src="https://github.com/user-attachments/assets/9e5bfd39-4189-4c7c-bf76-e7ea0df0464f"></video>

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2025-12-08 18:32:50 -05:00
Grateful Forest 3eec4d2406
jak1: fix high fps ripples + frozen ripples (#4067)
Have done some custom ripples so thought I could fix this. At first I
scaled ripple speeds before realizing that wouldn't work if you change
FPS mid-game.

Instead I found the delta increment is there as a variable, and just
scaled that increment directly. I followed the same convention used
everywhere; just multiply by `DISPLAY_FPS_RATIO`.

That was the easy bit, the hard part was a second, unrelated issue,
whether you scale the delta or not, which is on level entry at high fps,
it shows no water movement at all.

I saw the delta was always being created at 0.0 on high FPS, and saw the
delta was computed nowhere in GOAL, only mips2c. I found inspiration
from [this
patch](5ac5b6aae8/goal_src/jak1/engine/common-obs/ropebridge.gc (L605-L611)),
where the time ratio is changed to 60 FPS temporarily. However, fixing
the time ratio still created 0.0 deltas, and no matter what I did, it
always created 0.0 deltas.

I was about to give up, thinking there's no way to scale the mips2c
deltas. However, I found out why it was giving 0.0 deltas, which is on
high FPS, the video-mode is neither `pal` or `ntsc`, but `custom`, and
the misps2c code uses settings for `pal` or `ntsc`.

To include support for high FPS, I temporarily change it to `ntsc`, and
only apply this at the wave table creation when `custom`.
2025-12-08 18:32:20 -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
water111 0ea38cb2da
[jak3] Fix audio language setting (#4093)
Rename `Language` to `Audio Language` in the menu, and connect it to
`audio-language` instead of `language`.

After this change, we have:
<img width="559" height="322" alt="image"
src="https://github.com/user-attachments/assets/d928a91b-6184-4bde-b147-aa08f22b02d2"
/>


where 

- Subtitle Language controls `subtitle-language` on both PC settings and
the normal setting control (unchanged)
- Audio Language controls `audio-language` on setting-control
- Text Language controls `text-language` on PC settings and `language`
on setting control. The game looks at `(-> *setting-control*
user-default language)` to determine text scaling sometimes, so I think
it's good for this to set both.
2025-12-08 17:53:26 -05:00
Matt Dallmeyer fde7b3befb
[jak3] Fix temple % warp split (#4086)
I realized this `temple-defend-door-4` was getting triggered twice, once
during the temple skip % warp, then again when entering palace ruins %
warp (because it's un-closed by a restart mission, since the overall
`temple-defend` task isn't closed). `temple-defend-introduction` remains
closed after the restart mission, so works better here.
2025-12-08 17:43:18 -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 06d40b5f85
[jak3] Some autosplit changes (#4085)
Adds some additional autosplit points that I think will be useful. 

Also tweaks the `errol-dead?` condition to update immediately on the
final hit (there's a sec or so of animation before it returns to
`initial-state`, where it was being updated previously)

Corresponding autosplitter updates:
https://github.com/open-goal/speedrunning/pull/27
2025-11-28 00:12:24 +01: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
Grateful Forest 0fa93ce7b8
jak1: subtitle fixes (#4063)
Listened with RIG 500 headphones:

The farmer:
<img width="1920" height="1080" alt="1"
src="https://github.com/user-attachments/assets/0f399461-653e-412a-8e33-6a33e7f59277"
/>

I really could not hear that "spitting", percussive sound of the "p" for
"pack". I think it's unlikely the line is "pack" or "packed into the
pen".
The strong, healthy bass of "b" is more likely. Furthermore, he points
visually over his shoulder in the same moment, physically referring to
his own "back" as if referencing the past or a previous state.

The geologist:
<img width="1920" height="1080" alt="2"
src="https://github.com/user-attachments/assets/7ff7f4c3-2ded-41c1-84c7-1f6b44c5b081"
/>
"Lighting" to "lightning" would match consistency to the other
references to lightning moles. Listening to the sound, you can hear the
distinctly "nasally" sound of the "n" connecting the "light" and "ing".
2025-11-04 16:40:22 -05:00
Hat Kid 5ac5b6aae8
jak3: fix widescreen scissoring for mission and scene select (#4061) 2025-10-24 20:10:32 +02:00
Hat Kid 47620fd1a7
jak2, jak3: fix high fps vehicle smush (#4059)
Prevents instantly killing Jak when exiting some vehicles at high FPS.
2025-10-20 05:27:12 +02: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 4299b7d3fb
[jak3] Decouple dust storm particles & push vector from FPS (#4046)
The dust storm will now always behave as if it was at 60 FPS. Particles
only spawn every 1/60th of a second and the push vector is converted as
if it was originally equivalent to 1/60th of a second.
2025-10-08 15:30:33 +01:00
Alex 5618649695
Fix Jak 3 subtitle speaker colors (#4043) 2025-10-07 23:41:49 +01: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
Matt Dallmeyer 26597e8b9e
[jak1] Fix lavatube oranges autosplit (#4022)
Not sure if/how this ever worked. The old code splits if you mark the
task complete from the debug menu, but not from normal gameplay.

`autosplit-flag-task-complete!` checks if the `task-perm-list` has the
`real-complete` flag. Other than the debug menu and couple special
cases, it looks like `task-perm-list` entries only get marked
`real-complete` here when we get a fuel-cell

aad1b53ce3/goal_src/jak1/engine/game/game-info.gc (L287-L300)

Fixes one of the issues in #4021
2025-09-26 19:11:29 -04:00
Christopher Mowrey 8afdd9f704
jak2: progress: fix duplicate "Right Analog Stick Left" in keybind list (#4024)
Fixes #4023 

This fixes a duplicated entry in the Jak 2 keybind details page where
"Right Analog Stick Left" appears twice.

File: goal_src/jak2/pc/progress/progress-static-pc.gc
Change: corrected the :entries list to include r-analog-right once
and removed the duplicate r-analog-left, resulting in the 8 expected
analog directions (L and R sticks).

Repro: Options → Input → Reassign Binds → Keyboard (Jak 2)
Before: Right stick shows duplicate "Left"
After: Right stick shows Left/Right correctly
2025-09-19 16:52:04 -04:00
gsanjin 6b2ded266b
Add Bosnian language to Jak 1 (#4011)
Added Bosnian language - game and subtitles, complete translation of Jak
1.

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2025-08-29 21:14:27 -04:00
Matt Dallmeyer bbac33a8ae
Check that we have valid process before invoking event-hook (fix jak1 qbert crash) (#4006)
More info in #4005, which this fixes
2025-08-22 19:39:03 +01:00
Hat Kid 98c1aa4f8f
jak3: fix `was-pre-game` crash and `egg-spider` bbush (#4000)
Fixes #3997: The script for the orb that is spawned when getting a medal
in the satellite game was using the wrong entity name.
Fixes #3998: The `spider-manager` process was invalid for one frame,
causing the score to be set to the value of `#f`, winning the game
instantly.

Also doubled the PC port texture count, which should hopefully fix the
crash that happens when playing the game all the way through to the end
of the Destroy Dark Eco Tanks mission in one sitting.
2025-08-17 02:21:13 +02:00
Tyler Wilding 006d24b29a
game: Support korean in Jak 2 and Jak 3 (#3988)
Resolves #3075 

TODO before merge:
- [x] Properly draw non-korean strings while in korean mode (language
selection)
- [x] Check jak 3
- [x] Translation scaffolding (allow korean characters, add to Crowdin,
fix japanese locale, etc)
- [x] Check translation of text lines
- [x] Check translation of subtitle lines
- [x] Cleanup PR / some performance optimization (it's take a bit too
long to build the text and it shouldn't since the information is in a
giant lookup table)
- [x] Wait until release is cut

I confirmed the font textures are identical between Jak 2 and Jak 3, so
thank god for that.

Some examples of converting the korean encoding to utf-8. These show off
all scenarios, pure korean / korean with ascii and japanese / korean
with replacements (flags):
<img width="316" height="611" alt="Screenshot 2025-07-26 191511"
src="https://github.com/user-attachments/assets/614383ba-8049-4bf4-937e-24ad3e605d41"
/>
<img width="254" height="220" alt="Screenshot 2025-07-26 191529"
src="https://github.com/user-attachments/assets/1f6e5a6c-8527-4f98-a988-925ec66e437d"
/>

And it working in game. `Input Options` is a custom not-yet-translated
string. It now shows up properly instead of a disgusting block of
glyphs, and all the original strings are hopefully the same
semantically!:
<img width="550" height="493" alt="Screenshot 2025-07-26 202838"
src="https://github.com/user-attachments/assets/9ebdf6c0-f5a3-4a30-84a1-e5840809a1a2"
/>

Quite the challenge. The crux of the problem is -- Naughty Dog came up
with their own encoding for representing korean syllable blocks, and
that source information is lost so it has to be reverse engineered.
Instead of trying to figure out their encoding from the text -- I went
at it from the angle of just "how do i draw every single korean
character using their glyph set".

One might think this is way too time consuming but it's important to
remember:
- Korean letters are designed to be composable from a relatively small
number of glyphs (more on this later)
- Someone at naughty dog did basically this exact process
- There is no other way! While there are loose patterns, there isn't an
overarching rhyme or reason, they just picked the right glyph for the
writing context (more on this later). And there are even situations
where there IS NO good looking glyph, or the one ND chose looks awful
and unreadable (we could technically fix this by adjusting the
positioning of the glyphs but....no more)!

Information on their encoding that gets passed to `convert-korean-text`:
- It's a raw stream of bytes
- It can contain normal font letters
- Every syllable block begins with: `0x04 <num_glyphs> <...the glyph
bytes...>`
- DO NOT confuse `num_glyphs` with num jamo, because some glyphs can
have multiple jamo!
- Every section of normal text starts with `0x03`. For example a space
would be `0x03 0x20`
- There are a very select few number of jamo glyphs on a secondary
texture page, these glyph bytes are preceeded with a `0x05`. These jamo
are a variant of some of the final vowels, moving them as low down as
possible.

Crash course on korean writing:
- Nice resource as this is basically what we are doing -
https://glyphsapp.com/learn/creating-a-hangeul-font
- Korean syllable blocks have either 2 or 3 jamo. Jamo are basically
letters and are the individual pieces that make up the syllable blocks.
- The jamo are split up into "initial", "medial" and "final" categories.
Within the "medial" category there are obvious visual variants:
  - Horizontal
  - Vertical
  - Combination (horizontal + a vertical)
- These jamo are laid out in 6 main pre-defined "orientations":
  - initial + vertical medial
  - initial + horizontal medial
  - initial + combination
  - initial + vertical medial + final
  - initial + horizontal medial + final
  - initial + combination + final
- Sometimes, for stylistic reasons, jamo will be written in different
ways (ie. if there is nothing below a vertical vowel will be extended).
  - Annoying, and ND's glyph set supports this stylistic choice!
- There are some combination of jamo that are never used, and some that
are only used for a single word in the entire language!

With all that in mind, my basic process was:
- Scan the game's entire corpus of korean text, that includes subtitles.
It's very easy to look at the font texture's glyphs and assign them to
their respective jamo
- This let me construct a mapping and see which glyphs were used under
which context
- I then shoved this information into a 2-D matrix in excel, and created
an in-game tool to check every single jamo permutation to fill in the
gaps / change them if naughty dogs was bad. Most of the time, ND's
encoding was fine.
-
https://docs.google.com/spreadsheets/d/e/2PACX-1vTtyMeb5-mL5rXseS9YllVj32BGCISOGZFic6nkRV5Er5aLZ9CLq1Hj_rTY7pRCn-wrQDH1rvTqUHwB/pubhtml?gid=886895534&single=true
anything in red is an addition / modification on my part.
- This was the most lengthy part but not as long as you may think, you
can do a lot of pruning. For example if you are checking a 3-jamo
variant (the ones with the most permutations) and you've verified that
the medial jamo is as far up vertically as it can be, and you are using
the lowest final jamo that are available -- there is nothing to check or
improve -- for better or worse! So those end up being the permutations
between the initial and medial instead of a three-way permutation
nightmare.
- Also, while it is a 2d matrix, there's a lot of pruning even within
that. For example, for the first 3 orientations, you dont have to care
about final vowels at all.
- At the end, I'm left with a lookup table that I can use the encode the
best looking korean syllable blocks possible given the context of the
jamo combination.
2025-08-16 19:35:47 -04:00
Matt Dallmeyer 796a1f163b
[jak1] Don't update cell/orb/fly autosplit counters during blackout (#3996)
Similar issue to the orbs-per-level counts, while loading a save (in
blackout) these values are reset to 0 briefly. This can cause extra
autosplits (see https://github.com/open-goal/speedrunning/pull/25)
2025-08-16 12:32:19 -04:00
Matt Dallmeyer 690cc04625
[jak1] Allow skipping credits in speedrunner mode (#3981)
Speedrunners have seen the Jak 1 credits once or twice, I think we can
let them skip
2025-07-22 14:07:36 -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
Matt Dallmeyer 0ab252d39d
[jak1] Fix speedrun mode bug where loading a save is counted as new run (#3960)
Fixes a small bug introduced in #3902. 

Without this change, whenever you load a save it is treated as if you
started a new game and resets the autosplitter back to 0s.
2025-06-19 17:47:42 +02:00
water111 c08118509b
[jak3] Add BRANCH grain, make handler IDs unique (#3950)
Two changes that fix some Jak 3 audio bugs.

In some areas, sound effects would seem to cut off randomly. This was
caused by the sound code reusing IDs, but overlord didn't realize. It
would try to kill a sound effect by ID that had already died, and the ID
was reassigned to a new sound. To fix this, I made the handle IDs always
increment. I also tested starting the ID at large numbers and confirmed
that worked.

I also added support for the BRANCH grain. This makes the
`wastelander-shot` and possibly other sound effects work. It doesn't
support all the features, but this is probably enough.

Fun fact: the wastelander shot is supposed to have 7 variations, but you
always get the same one because they set the sound mask wrong.

I added a line you can uncomment if you want to experience the other 6
variations.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-06-07 22:34:03 -04:00
Tyler Wilding 77586b7fa9
game: default MSAA to off (#3943)
There's a suspicion that MSAA might be what causes the black screen
problem for some users, additionally this can cause perf issues for
people with really bad PCs so this is probably a better default.

Needs testing before merging, i think this is all inclusive though.
2025-06-03 23:58:05 -04:00
water111 fce2dad3c0
[jak3] Fix disabling nav (#3941)
This needs a parameter, otherwise it was reading some uninitialized
value. In some cases, the uninitialized value would leave the nav stuff
on, and the marauders would go crazy trying to avoid each other.
2025-06-02 21:51:22 -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
Tyler Wilding 23262ce269
g/j2: add hack workaround to prevent `atoll-sig` mission getting stuck due to NaN bones (#3935)
Related to #3929 

Played through the mission, worked fine. This condition should _never_
be hit under normal circumstances
2025-06-01 18:50:11 -04:00
water111 228dfd82d1
[jak3] Small bug fixes (#3933)
Fixes the pillars being transparent (but is a bit of a hack), the desert
sand not having texture filtering, and the "No memory card" on the title
screen with debug mode off.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-06-01 13:24:28 -04:00
Tyler Wilding b6649d2433
Properly set window size when switching from borderless/fullscreen -> windowed mode (#3923)
Prior to SDL3, borderless windows were kinda a hack, they cleaned all of
that up. The side-effect of that is that the C++ code keeps track of the
current window size (it does this for framebuffer sizing, but also to
set the size of the window).

This is now an issue because SDL is properly firing events when you
change to borderless mode, so our window size gets updated to the size
of the entire monitor. When you switch to windowed mode from borderless,
it now seems like it didn't work (it did, its just still taking up the
entire screen).

This could be better cleaned up if more settings are extracted out of
GOAL and put into C++ so they can be managed and accessed where they
belong. But for now, this is a minimally invasive fix.

Fixes #3917
2025-05-31 18:47:02 -04:00
Alex a6c21a9814
Implement analog stick sensitivity setting, default it to 133% (#3919)
This is a simple multiplier to the gamepad axis input value received
from SDL events. Normally the values it provides cannot satisfy the
square range of the stick input. This is usually fine but it might play
differently with different controllers and compared to consoles,
especially considering the DualShock 1/2 have automatic calibration
which works in mysterious ways. The setting is there so any user can
adjust it for their controllers.

Saved to and loaded from the input-settings.json file.

133% matches PCSX2's default setting and is generally a good value to
map the square stick range within most modern(ish) controllers' circular
stick motion.

Progress menu option added to Jak 1 and 2. Setting can be changed from
50% all the way to 200%.

~~Renamed the analog deadzone options to stick deadzone since they don't
apply to the other analog buttons and only the (analog, yes) sticks.~~
2025-05-27 16:01:06 +01:00
Tyler Wilding 85e3203188
g/jak2: don't try to print subtitles that don't exist (non-base language) (#3910)
Fixes #3909 

Long standing issue in Jak 2's subtitles, it's actually kinda incredible
that finnish didn't run into this problem. Later in this code it
accesses the subtitle based on the language-id, and finnish is always
out of bounds -- but it never caused a catastrophic issue.

Polish on the otherhand is much more out of bounds and always causes an
access violation / crash.

Jak 2's subtitle code has no fallback (ie. use english if not
translated) for cutscenes, since they are not defined in the base file
like in Jak 1. This means that an untranslated language will render no
subtitles during cutscenes. Translations are welcome!.

Tested a cutscene in:
- english 
- italian (base game with subtitles)
- finnish (new language, actually is translated)
- polish (new language, not translated)
2025-05-12 22:41:48 -04:00
Tyler Wilding 67f62560af
g/j2: change and initialize jak 2 subtitles correctly (#3907)
Fixes #3906

Wasn't an issue on Jak 1 because that game had no original subtitles,
but jak 2's subtitles still go through their original code, which uses
the `*setting-control*` object. This is a regression from when i
recently added all languages to the menu options.

- Update the setting at runtime
- Update the setting at initialization time

This may be an issue in Jak 3 as well if the code was copied over. We'll
fix it when we get there.


![image](https://github.com/user-attachments/assets/19a796a7-a3f3-4872-98f8-7fcbe91b3ec1)

![image](https://github.com/user-attachments/assets/356f751a-5406-41f3-b616-97ece2782a88)
2025-05-09 21:37:05 -04:00
Matt Dallmeyer 4e28bd1eaf
[jak1] Speedrun mode misc fixes (#3902)
Fixed up a few things for speedrun mode in Jak 1:
- Changed autosplitter to start run in line with ruleset (first frame
after blackout where jak is touching ground). Also tweaked the
verification text in bottom left to show "Run Started: Yes/No" to go
with this
- Changed speedrun menu button combo to match Jak 2/3 (only need to hold
L1+R1 and press Start/Select, no longer need to hold X)
- Treat speedrun menu via Select the same as Start (no more potential
for funny pause buffer where actors freeze)

warp gate example:

![vlcsnap-2025-04-26-12h03m37s116](https://github.com/user-attachments/assets/3a06c3fe-0c60-4d8d-acaa-ec5f66145491)

![vlcsnap-2025-04-26-12h03m42s642](https://github.com/user-attachments/assets/e12439d4-1664-46a1-bfc0-56c737463603)

already grounded example (run starts once partially out of blackout):

![vlcsnap-2025-04-26-12h04m02s085](https://github.com/user-attachments/assets/71659b45-b599-4ca1-b097-cf736f845933)
2025-04-26 23:23:55 +02:00
Hat Kid c61a69d751
jak3: wip pc progress code (#3898) 2025-04-16 20:57:43 +02:00
Matt Dallmeyer e122941ede
Fix pagination for non-dynamic popup menus (speedrun menu) (#3883)
Was testing out adding ILs to the speedrun menu and noticed this wasn't
working properly

(video before the changes)

https://github.com/user-attachments/assets/e1e7f443-60d2-4b15-bc27-a20cbe4442d6

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2025-03-31 15:40:40 -04:00
Tyler Wilding 1f6438e517
deps: update to SDL3 (#3852)
This PR updates to SDL3, and with it, adds a handful of new features.
Everything seems to work but I'm going to look over the code once last
time before merging, some of the API changes are hard to spot.

Fixes #2773

### Pressure sensitivity support for DS3 Controllers

SDL3 adds pressure sensitivity support for DS3 controllers on windows. I
have not tested on linux. The option is disabled by default.

On windows you will need https://docs.nefarius.at/projects/DsHidMini/
and to be using SXS mode.

### DualSense and Xbox One Trigger Effects

If enabled, Jak 2 will have certain trigger effects.  They are:
   - xbox1:
     - small vibrate when collecting dark eco
     - big vibrate when changing to dark jak
     - vibrate when shooting gun, proportional to gun type
   - ps5:
     - resistance when changing to dark jak
     - different gun shooting effects
       - red (resistance)
       - yellow (weapon trigger)
       - blue (vibrates)
       - purple (less resistance)
> **Gun Shooting effects are only enabled if the new "Swap R1 and R2"
option is enabled**

There are more effects that could be used in `dualsense_effects.cpp`,
but I only exposed the ones I needed to OpenGOAL. If a modder wants to
use some of the others and wires them up end-to-end, please consider
contributing that upstream.

### New ImGUI Menu

Added new imgui options for selecting the active controller, for those
people that struggle to select the initial controller.


![image](https://github.com/user-attachments/assets/48ff2985-d9ef-417a-b1f2-a25c74595935)

### Testing

The highlights of what I tested successfully:
   - display
     - [x] all mode switch permutations
     - [x] launch with all modes saved
- [x] switch monitors / unplug monitor that was active, how does it
handle it
     - [x] load with alternate monitor saved and all modes
     - [x] allowing hidpi doesnt break macos
   - controls
     - [x] keyboard and mouse still work
     - [x] pressure sensitivity on linux
2025-03-02 16:36:22 -05:00
Tyler Wilding b2289e844c
g/j2: persist subtitle language properly, eliminates a crash (#3872)
Fixes #3870
2025-03-01 13:17:38 -05:00