Commit Graph

2714 Commits

Author SHA1 Message Date
water111 b3cdcf3a67 custom actor, fix animation compression (#3802)
Fix a missing scale factor when using the large mode in the animation
compressor. This would make some joints have a translation of near 0 if
the original animation had stuff moving a large distance

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-12-14 11:14:55 -05:00
OpenGOAL Bot 0edb88dc69 CI: Periodic Controller Database Update (#3779)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2024-12-10 16:53:36 -05:00
Hat Kid c476b84182 custom models: option to copy mod/eye draws from original model (#3800)
Two new flags were added to the Blender plugin to allow reusing the mod
and/or eye draws of the original model that is being replaced. Works
pretty well for eyes, but the blerc draws can cause some Z-fighting with
the non-moving parts of the model.

Also a small refactor to the merc replacement code to de-duplicate some
code by moving stuff to `gltf_util.cpp`.
2024-12-09 20:49:56 +01:00
water111 5458d865d4 [Custom Levels] Improve color palette generation (#3797)
A few improvements to color palette selection. These were made by
tracing some particularly bad colors through and seeing where it made
obviously bad decisions for splitting. I tested on crystal cave, and a
test GLBs from Kuitar that previously had issues with alpha.

- The previous approach to splitting was based on trying to keep a tree
of deduplicated colors balanced (same count in each leaf). This is not
really a good idea for generating color palettes. A better approach is
to try to minimize the volume of the child node, limiting how inaccurate
a color can be. Splitting is now chosen based on the average of the
_deduplicated channel values_, which in practice seems to work pretty
well for Kuitar's levels. Other approaches could work here too.
- The previous approach of alternating through dimensions to split on
was kept.
- The depth of the KD tree during the initial split was increased,
allowing it to use up to 8192 colors, instead of just 1024.
- In most cases, not all child nodes of the tree have colors in them,
meaning that a tree of depth 13 would have less than 8192 colors. If
this happens, child nodes are split until the color count reaches 8192.
The selection of which nodes to split is somewhat arbitrary, but is
breadth-first. The axis for splitting is the one with the largest range.
(which might be a better idea in general?)

On crystal-cave, the worst case color error was reduced from 221 to 9.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-12-08 12:31:48 -05:00
Hat Kid 51d008f9ab decompiler: detect and turn inverse mult to div (#3795)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2024-12-07 23:10:49 +01:00
water111 a2f9d36332 Fix animation processing interpolation bug, crash on no merc material (#3794)
Fixes the issue with animations doing a full 180 degree rotation and
disappearing. The quaternions in the GLB export "flip", and when
interpolating animation frames in between a flip, we got bogus
quaternions.

Fixes https://github.com/open-goal/jak-project/issues/3786

Also fix a crash in `goalc` when using merc models without any
materials.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-12-07 13:42:48 -05:00
ZedB0T 6e4e5d2bf7 Add option to hide the imgui bar with a click event (#3791)
Should cover edge cases where the bar is displayed and a keyboard type
device is not connected to the system (Steam deck/touch input based
device instead).

While it should probably be impossible to display the bar in the first
place on such devices it apparently isnt ->
https://www.reddit.com/r/jakanddaxter/comments/1h4mht1/how_to_remove_grey_bar_at_top_on_steamdeck/

And even ignoring the whole steamdeck/no keyboard thing adding another
way to hide it that is visible on the bar should help reduce people
asking about how to hide it. (And hopefully help people who dont
ask/dont know where to ask!)



https://github.com/user-attachments/assets/7f132781-675c-451e-8b39-2a78fa098b9e
2024-12-07 13:42:39 -05:00
water111 1029516f6d [sound] Add instance limits (#3769)
Add instance limits to the sound library, and a `dump-info` command to
`sndplay` to print out all the sounds/flags in an SBK file.

This is based on the decompiled 989snd library @Ziemas is working on
(https://github.com/Ziemas/dec989snd/blob/main/src/sndhand.c#L77)

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-12-07 13:41:45 -05:00
Hat Kid 8690104ba0 jak1: add merc version of draw-bones-hud (#3793)
Add a version of `draw-bones-hud` that uses merc to support drawing
foreground HUD elements that use custom models.
2024-12-06 20:25:20 +01:00
Hat Kid e18dbb6256 jak3: fix cloth disappearing after 600 orbs (#3790)
After collecting 600 orbs, cloth systems that didn't have any
`alt-tex-name`s defined would vanish because the `static-cloth-params`
macro doesn't default them to `#f`.
2024-12-02 17:43:41 +01:00
Hat Kid 477cefb6a5 model replacements: prevent duplicate processing (#3789)
Store a small database of which models have already been swapped out in
a level to prevent duplicate processing.

Also a small fix for cases where using a model replacement that has no
armature would cause merc nightmares due to only having a `max_bones` of
3.
2024-12-01 22:01:50 +01:00
Tyler Wilding 8feb46dc45 ci: hopefully fix MacOS CI in preparation for release (#3788)
Folder names were in common with the normal intel x86 build, the release
wasn't going to work. Hopefully with these changes it will but, still
technically untested. Don't have time to do so tonight.
v0.2.20
2024-11-30 22:27:52 -05:00
Hat Kid 620168c45a custom models: ignore invalid envmap material (#3785)
If a model has a material with specular properties, but is missing a
roughness texture, warn and treat it as a normal draw instead of
erroring out.
v0.2.19
2024-11-29 09:27:46 +01:00
massimilianodelliubaldini 4c2e1a8a90 Remove 128 character buffer causing long filenames to crash gk (#3771)
Several users have reported that ArchipelaGOAL is not launching
properly, even when using the OpenGOAL Launcher. The window pops up with
a black screen, and then quits. The only way they can run it is if they
double click gk.exe.

This comes down to the Launcher providing gk.exe with the `config_path`
parameter, which leads the program to find `archipelagoal-settings.gc`.
Here is an example from me:

```
D:\Applications\Games\OpenGOAL\features\jak1\mods\JakMods\_settings\archipelagoal\OpenGOAL\jak1\settings/Mods/archipelagoal-settings.gc
```

If a user's base OpenGOAL install directory is long enough, this path
becomes longer than 128 characters. This overflows the character buffer
in `kopen` which is used to open file streams. If you're only slightly
over the limit like myself, at 135 characters, you may not have noticed
a problem. But some users have paths a little longer, like 168
characters, and they report the issue is consistent.

Water111 suggested we remove the 128 character buffer and use the
filename data directly. This fix requires no changes to the Launcher,
just to the kernel, and every mod could stand to benefit from this fix.
2024-11-28 17:14:09 -05:00
Hat Kid ef719d2ab7 custom models: better error for invalid envmap material (#3784)
When a material in Blender has its IOR level changed to anything other
than the default value of 0.5, the `KHR_materials_specular` extension is
applied during the glTF export, which is what we use to check for
envmaps in custom models. If an envmap is undesired, but the IOR value
was accidentally changed, the program would assert during model
processing if there is no metallic roughness texture attached to the
material.

Since this is an easy mistake to make and is hard to spot, this adds a
better error message for such cases.
2024-11-27 19:14:23 +01:00
Hat Kid 7848ba05b8 jak3: fix music not pausing (#3783) 2024-11-27 15:46:41 +01:00
Hat Kid f6c55eba9f custom models: increase default joint count (#3782) 2024-11-27 04:21:33 +01:00
Hat Kid 6a06291e6e jak1, jak2: add get-texture macro (#3778)
Ports the `get-texture` macro added in Jak 3 to Jak 1 and 2.
2024-11-26 11:29:34 +01:00
Tyler Wilding 9b393e2ddb ci: update minimum macOS supported version to Ventura (13) (#3780)
macOS 12 has been end of life for 2 months, GitHub is removing support
for the images very soon (within a week or so).

https://endoflife.date/macos
2024-11-25 14:43:48 -05:00
Brendan Shanks 3f7aca3c72 Taskfile: Call 'python3' on non-Windows platforms (#3752) 2024-11-25 13:40:56 -05:00
Hat Kid c263bc2114 custom models: envmap support (#3777)
Custom models and model replacements now support environment mapping.

Also fixed some cases in Jak 3 where tfrags had missing textures
(defaulting to texture 0 from tpage 0, which in Jak 3 is the default eye
texture) and replaced them with more suitable alternatives.

Fixes #3776 


https://github.com/user-attachments/assets/7c11b0de-b254-40cb-9719-11238dfb3d43


![image](https://github.com/user-attachments/assets/4cc60b55-4965-4cb8-b29d-096560e7b3aa)


![image](https://github.com/user-attachments/assets/cb46d0d1-57d7-482c-b235-15d0e633f62c)
2024-11-23 14:32:55 +01:00
Hat Kid 2ff49b9905 jak3: fix ragdolls settling too early (#3775)
`none` methods strike again

Fixes #3774
2024-11-22 02:36:50 +01:00
Brendan Shanks 8f445bda3e Create separate x86_64 and ARM64 macOS targets. (#3760)
Create explicit x86_64 and ARM64 macOS build targets, so it's clear that
the CI is building x86_64 binaries (on both Intel and ARM64 build
machines). Also, use the `CMAKE_APPLE_SILICON_PROCESSOR` CMake variable
(which sets `CMAKE_SYSTEM_PROCESSOR`) so `BUILD_X86_ON_MACOS` is not
necessary.

And update the README.
2024-11-17 15:59:57 -05:00
water111 24ad5515f8 [jak3] workaround for intro crash on screen filter (#3770)
Simple workaround to put an effect in a different bucket. I don't think
there's a difference in the result, but this is just easier to handle on
the PC renderer side.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-17 12:09:22 -05:00
Hat Kid 7543acfb8a jak3: speedrunner mode (#3761)
Base implementation of the popup menu and speedrunner mode in Jak 3.
Autosplitter is untested because I'm on Linux.

Also a couple of other misc changes:

- Model replacements can now have custom bone weights. Needs the "Use
Custom Bone Weights" property (provided by the OpenGOAL Blender plugin)
enabled in Blender.
- Better error message for lump syntax errors in custom level JSON
files.
2024-11-17 06:45:34 +01:00
water111 5e3cb8faa6 [jak3] Fix stack layout for car spawn (#3765)
Fix for cars spawning under ground or in weird places

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-16 17:52:14 -05:00
water111 321a113dd7 [jak3] Fix overlord soundbank unload, fix warnings (#3762)
Fix compiler warnings, and a bug where the `snd_handle` of
`SoundBankInfo` was never set, leading to sound banks never unloading.

The game relies on unloading soundbanks to make sure certain sounds
don't play, like the blue gun 1 fire noise when using blue gun 2.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-16 15:04:56 -05:00
OpenGOAL Bot 63676c70a5 CI: Periodic Controller Database Update (#3757)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2024-11-13 11:16:40 -05:00
Tyler Wilding 2c6d41c87a macOS: Fix issue causing only part of the window to be rendered to (#3756)
The fundamental issue is related to hiDPI / Retina displays, I don't
think our rendering code is setup properly to handle the scaling between
the two (which you can derive by comparing `SDL_GetWindowSize` and
`SDL_GL_GetDrawableSize`).

So rather than opening that can of worms, I just removed the window
flag.

Also fixed an unrelated issue for displaying resolution options when in
windowed mode, it was previously only adding options to the list if they
were invalid for full-screen.

Fixes #3099
2024-11-13 11:16:30 -05:00
Matt Dallmeyer 2a41bc615e [jak2] Fix bug where spinning into grind doesnt break clasps in dig1 (#3740)
if you sideflip into grind in the digsite mission, the clasps wont break
because it is considered a `board-spin` attack instead of `board`. This
extends the condition to allow for `board-spin` as well.

~~Should I wrap this in an `#if PC_PORT`?~~ done
2024-11-12 20:59:21 +01:00
water111 7553877e57 Fix crash in ocean-far with invalid DMA size (#3746)
DMA sizes are 16-bits, not 12-bits. This would cause rare crashes when
the ocean far renderer uses more than this.

I'm not really sure what the ocean far rendering is doing at this time,
but it happens as stuff is loading in.

There's a chance this fixes crashes in jak 2 as well, since we used to
see errors that would be explained by this.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-12 19:38:51 +01:00
Hat Kid af5cb9b1cb jak3: subtitle3, vag-player (#3758) 2024-11-12 02:45:16 +01:00
Tyler Wilding b55a918902 deps: commit rapidjson with 8 year old fix (#3755)
Fixes https://github.com/open-goal/jak-project/issues/3753 hopefully

Rapidjson is never cutting a release, ever, and even if they did, the
discord-rpc library is deprecated so it would never consume it.

Instead of updating 8 years worth of changes and praying that works, I
just made the alleged fix from 8 years ago and changed discord-rpc's
cmake to not pull from the release.
2024-11-10 11:57:50 -05:00
Tyler Wilding f8058f2138 Support Apple Silicon via Rosetta2 on MacOS Sequoia and Above (#3754) 2024-11-10 11:06:56 -05:00
OpenGOAL Bot e3efede029 CI: Periodic Controller Database Update (#3749)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2024-11-09 12:05:01 -05:00
Brendan Shanks 4604636593 Fix sprite3_3d.vert on macOS (#3750)
Fixes a regression in #3722.

```
[18:34] [error] Failed to compile vertex shader sprite3_3d:
ERROR: 0:122: '&' does not operate on 'unsigned int' and 'int'
ERROR: 0:129: Use of undeclared identifier 'xy0_vf19'
ERROR: 0:129: Use of undeclared identifier 'xy0_vf19'
ERROR: 0:144: '&' does not operate on 'unsigned int' and 'int'
ERROR: 0:151: Use of undeclared identifier 'xy0_vf19'
ERROR: 0:151: Use of undeclared identifier 'xy0_vf19'
```
2024-11-06 22:30:01 -05:00
Brendan Shanks 8930141b72 docs: Remove instructions to add go-task tap to Homebrew. (#3751)
Homebrew has its own formula for go-task which is up-to-date and
working.
2024-11-06 22:27:15 -05:00
water111 1e530714b7 [jak3] Fix for precd extraction (#3744)
It looks like one of the tie models in this level has bad color data in
the lowest LOD. For now, just skip extracting the lowest lod for this
TIE only.

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-11-03 11:43:27 -05:00
Hat Kid cbb8add81c jak2: fix consite crash (#3743)
Since #3735, loading consite in Jak 2 crashes due to an assert in the
code that handles the PC clut blender DMA. The unused and
half-implemented `kor-transform` texture animation doesn't have any
blenders as the texture names are commented out in the C++ definition
(and it seems that these textures are defined multiple times within
different tpages in the same DGO, leading to errors during startup if
uncommented), leading to a mismatch between the actual qwc in GOAL and
the assumed DMA data size in C++.
v0.2.18
2024-11-03 10:45:31 +00:00
Hat Kid 10d7dabfd7 game: move pc-encode-utf8-string to common kmachine code (#3742)
Also adds formatter rules for a couple of macros.
2024-11-03 01:28:48 +01:00
Alex ba9085fee0 [jak2] Correct behavior of hint subtitles toggle (#3741)
Re-uses the existing "hinttitles" toggle that's already there, and makes
it not depend on if the main subtitles are on or not.
2024-11-02 18:28:20 +00:00
OpenGOAL Bot 5e8ea23c30 CI: Periodic Controller Database Update (#3737)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2024-10-28 21:36:26 -04:00
ZedB0T 2f0a90b693 Update LICENSE, and add jak 2/3 iso_data folders (#3738)
- Updates the LICENSE
- Adds empty Jak 2/3 folders to iso_data following the pattern
established by the jak1 folder.
2024-10-29 00:29:19 +01:00
Hat Kid 348bf83b89 custom levels: add draco lib to support compressed glb files (#3723)
By adding the `draco` library as a dependency, `tinygltf` can support
GLB files compressed with the Draco compression algorithm which allows
for drastically reduced file sizes for custom levels (TFL's Crescent Top
GLB for example went from 135 MB to 37 MB).
2024-10-28 21:11:19 +01:00
water111 dff9ac163a [custom levels] A few bug fixes (#3736)
- Bug fix to KD tree splitting, should fix cases with bad vertex
colors/alphas.
- Normalize normals instead of asserting if they are the wrong length.
**the fact that blender exports normals incorrectly is a bug and I doubt
their implementation is correct if you've scaled things on only on
axis.**
- Automatically resize metallic texture (envmap strength) if it doesn't
match the size of the rgb texture instead of asserting

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-10-27 12:31:41 -04:00
water111 1962fbfb51 [jak2,3] Support loading clut blender animated textures to the pool (#3735)
Animated textures that use the clut blender can now upload them to the
texture pool, so they can get read by the eye renderer. This will also
fix darkjak's eyelids in jak 2.


![image](https://github.com/user-attachments/assets/5edbd20d-53c9-42c6-937d-6263823b8b45)

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-10-27 09:21:44 -04:00
water111 5bc61c5854 [jak3] Support texture anim in TIE (#3734)
Support animated textures in TIE. Apparently this is also used in jak 2
for robotank and we never noticed??


https://github.com/user-attachments/assets/bfa45a1a-4a96-4b25-817a-4327afcc7c98

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-10-26 15:47:34 -04:00
water111 510b23163f [jak3] Misc texture anim fixes (#3732)
- fix issue where animated textures that use the size-override feature,
and aren't being animated would show up as black - fix for black water
in spargus
- fix issue where animated texture uses another animated texture as an
input wouldn't get the animated version.
- fix math mistake in how animated texture rotations are handled. This
could cause textures to not rotate when a positions were rotated, but
textures (st's) weren't.
- fix definition of the ring texture to handle
set-alpha-texture-anim-layer-func



![image](https://github.com/user-attachments/assets/979748b0-7abf-46a5-bf9d-693fb0ef34fb)


![image](https://github.com/user-attachments/assets/3011662c-bfec-4ce9-ad72-8853b3784f77)



https://github.com/user-attachments/assets/0242a59d-62bd-4799-8f6f-2a0aba63649f

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-10-26 14:32:55 -04:00
OpenGOAL Bot cb51bd3f5b CI: Periodic Controller Database Update (#3726)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2024-10-21 20:49:38 -04:00
Tyler Wilding e76a4399e5 game: Update game's GPU test to output the GPU vendor info (#3717)
This is so I can get rid of wgpu from the launcher, where it's only
purpose is to figure out the GPU name for the support package.

The problem with it is that on some environments, it errors, but the
function cannot have it's errors gracefully handled (it panics and
crashes instead).

So I'm tired of it, do it ourselves.


![image](https://github.com/user-attachments/assets/fa8ae365-b3f7-4794-81ed-fde0c2ffc651)
2024-10-19 15:56:43 -04:00