Commit graph

432 commits

Author SHA1 Message Date
water111 fe29eae395
Background improvements for custom levels (#3672)
This only applies to the background for now:

- support for alpha for vertex colors in custom levels
- switch time of day palette generation from octree to k-d tree
- support for alpha masking in custom levels
- support for transparent textures
- support for envmap in custom levels

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2024-09-21 11:39:50 -04:00
Hat Kid bc66d416b4
decompiler: call-parent-state-handler and suspend-for macros (#3625)
Some checks failed
Build / 🖥️ Windows (push) Has been cancelled
Build / 🐧 Linux (push) Has been cancelled
Build / 🍎 MacOS (push) Has been cancelled
Inform Pages Repo / Generate Documentation (push) Has been cancelled
Lint / 📝 Formatting (push) Has been cancelled
Lint / 📝 Required Checks (push) Has been cancelled
Lint / 📝 Optional Checks (push) Has been cancelled
Also fix `hud-draw-pris2` bucket in Jak 3 to make subtitles work and
foreground HUD envmap.
2024-09-04 19:35:54 +02:00
Tyler Wilding 4c10b42841
game: add per-game app icons (#3634)
Some checks failed
Build / 🖥️ Windows (push) Has been cancelled
Build / 🐧 Linux (push) Has been cancelled
Build / 🍎 MacOS (push) Has been cancelled
Lint / 📝 Formatting (push) Has been cancelled
Lint / 📝 Required Checks (push) Has been cancelled
Lint / 📝 Optional Checks (push) Has been cancelled
2024-08-16 16:01:03 -04:00
Hat Kid a66d832b2f
jak3: add more prim buckets (#3618)
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Used by `prebot`
2024-07-30 19:50:00 +02:00
Hat Kid ce978638fe
jak3: add darkjak highres texture anim (#3611)
Eyes don't work yet
2024-07-28 02:45:00 +02:00
water111 9d0009715e
[jak3] Fix alpha for prims, entity-table (#3609)
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Inform Pages Repo / Generate Documentation (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
Fix issue where light-trail is invisible and some actors not spawning
due to out of memory.
2024-07-27 12:46:33 -04:00
Tyler Wilding 92c4390f0a
jak1: Adjust sprite positioning or hide them where appropriate when using non-standard aspect ratios (#3596)
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Inform Pages Repo / Generate Documentation (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
This attempts to do a best-effort quick fix for the sprite alignment in
the menus and first person views on higher aspect ratios. This:
- Hides the binocular borders completely when using a non-standard ratio
![Screenshot 2024-07-20
021430](https://github.com/user-attachments/assets/c56d3a6c-13b0-43e1-b99b-83292993728c)
- Hides the borders in jak's first person view when using a non-standard
ratio
![Screenshot 2024-07-20
021310](https://github.com/user-attachments/assets/fefca993-960b-4741-87b7-6d7c17efe89d)
- Uses a combination of manual alignment and approximation to get the
pause menu closer.
![Screenshot 2024-07-20
151725](https://github.com/user-attachments/assets/2c8aa759-b33a-4fbe-abc6-b5861fc33208)
> 32:9 screenshot.

I accomplished the last one by manually aligning all of the core sprites
and text for the most popular aspect ratios. This means that from a
practical standpoint, things should align "perfectly". However, I then
used all of those values to derive a polynomial for each adjustment
based on the aspect ratio. This allows the game to do a half-decent
approximation/interpolation for every aspect ratio in-between the common
ones. It won't be perfect, but it will be better than this:

![image](https://github.com/user-attachments/assets/420b1e38-6f88-436a-8e8c-21df6b49428e)
2024-07-26 23:15:51 -04:00
water111 82a23c747e
[jak3] prim rendering for cloth (#3607)
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Inform Pages Repo / Generate Documentation (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
2024-07-26 20:31:32 -04:00
water111 f0b46ff2e5
[jak3] A few bug fixes (#3606)
A few minor fixes:

- Fix crash in overlord3 during final boss
https://github.com/open-goal/jak-project/issues/3605
- Update goal_src for `scene-actor.gc`, which was not updated after a
bug fix for decompiling skelgroups, making some cutscene actors
invisible due to using the wrong joint for culling checks.
- Stop using `-1` as an invalid value for texture id's in Merc.cpp. This
could sometimes cause Merc2.cpp to accidentally skip updating the OpenGL
texture. This fixes the bug where skull gems sometimes didn't have the
animated textures.
2024-07-26 13:48:43 -04:00
water111 9d80ada016
[jak3] Fix eye slot assignment and textures (#3603)
I found two issues with Jak 3 eyes. The first was simple - we were
missing a `-pc` texture upload in `texture.gc` for `pris2` textures,
which has eye textures for a few characters, like torn or damas.

The second was a little more annoying. Unlike jak 2 and jak 1, jak 3 can
dynamically assign eye slots when merc models are loaded. This involves
modifying eye data to tell the eye renderer where to render, and
modifying the merc model's adgif shaders to point to the correct eye
texture. The modification to the merc adgif shader is problematic since
our PC port of merc assumes this slot is constant.

My solution here was to bypass this whole slot system entirely for jak
3. I modified the GOAL eye renderer to tell the c++ eye renderer the
name of the merc-ctrl containing the eye. Then, the PC C++ Merc renderer
can just look up the merc-ctrl by name. To make this fit nicely in the
existing memory layout, I used a 64-bit fnv hash of the name. (which
honestly is how we should have handled a lot of other texture/model
names stuff...)

Unrelated fix to Overlord2 so it handles the case where file size
changes after the game starts, I had this in jak2/jak1 and forgot it for
jak 3.
2024-07-26 11:42:52 -04:00
water111 e81431bd21
[wip] Jak 3 Overlord (#3567)
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Inform Pages Repo / Generate Documentation (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
2024-07-26 09:42:28 -04:00
Hat Kid edae60d58d
decompiler: support merc model replacements and adding custom actor models to vanilla fr3s (#3597)
Some checks failed
Build / 🖥️ Windows (push) Has been cancelled
Build / 🐧 Linux (push) Has been cancelled
Build / 🍎 MacOS (push) Has been cancelled
Inform Pages Repo / Generate Documentation (push) Has been cancelled
Lint / 📝 Formatting (push) Has been cancelled
Lint / 📝 Required Checks (push) Has been cancelled
Lint / 📝 Optional Checks (push) Has been cancelled
This adds support for replacing existing merc models in FR3 files with
custom GLB model files. The replacements go in
`custom_assets/<GAME>/merc_replacements`, similar to texture
replacements. When a `.glb` file with a file name that matches any model
present in an FR3 is detected (e.g. `eichar-lod0` for Jak), all merc
model data is replaced with the given model.

Additionally, models for custom actors can now also be added to vanilla
FR3s. The models for this go in
`custom_assets/<GAME>/models/<LEVEL_NAME>` (e.g.
`custom_assets/jak1/models/jungleb/test-actor-lod0.glb`) and will be
added to the FR3 that has a matching name (exception: to add things to
the common level file, the folder should be named `common` instead of
`GAME`).
For custom levels, these now go in
`custom_assets/<GAME>/models/custom_levels` (previously
`custom_assets/<GAME>/models`).

Another small change: When level ripping is enabled, the resulting model
files will now be stored in game name subfolders inside of `glb_out`.
2024-07-21 01:51:31 +02:00
Tyler Wilding 849ba391d4
game: log more OpenGL info (#3588)
Logs the OpenGL vendor and renderer, in most cases this helps identify
what GPU the game is using, which is something that comes up from
time-to-time in support.


![image](https://github.com/user-attachments/assets/4d9ca6fa-f3ea-440e-bce2-7d22dab21ec6)
2024-07-16 19:40:50 -04:00
Hat Kid c8fbe26c7d
jak3: fix texture anim alpha (#3587)
Some checks failed
Build / 🖥️ Windows (push) Has been cancelled
Build / 🐧 Linux (push) Has been cancelled
Build / 🍎 MacOS (push) Has been cancelled
Lint / 📝 Formatting (push) Has been cancelled
Lint / 📝 Required Checks (push) Has been cancelled
Lint / 📝 Optional Checks (push) Has been cancelled
2024-07-15 21:39:44 +02:00
Hat Kid fbab87b0fe
jak3: fix opengl error spam (#3586) 2024-07-15 20:21:52 +02:00
Hat Kid bdded9ad8c
jak3: add missing texture animations (#3577)
This refactors some of the texture animation code a bit to better
support multiple games and adds most of the missing texture animations
for Jak 3 with a couple of exceptions/bugs:

- `hanga-sprite`: Despite `move_to_pool` being set for this anim, it's
not showing up in-game, but it does display properly in the ImGUI debug
window.

![image](https://github.com/open-goal/jak-project/assets/6624576/29df8e17-8831-412b-b9b7-7704d6bd7813)
- `factoryc-alpha`: Some conveyors do not have the animation for some
reason.

![image](https://github.com/open-goal/jak-project/assets/6624576/209ef073-2a81-4e2c-b020-dc2ae0b01196)
- This spot in Spargus seems to use texture animations, but it looks
like it maps to the `fora-water-dest` texture/slot, which comes from
`foresta-water`. Because the texture is not initialized, the texture
shows up black on first load, but it does show up after loading
`foresta`.

![image](https://github.com/open-goal/jak-project/assets/6624576/1e54bab2-f97c-47d5-a92a-a98a52c30178)

![image](https://github.com/open-goal/jak-project/assets/6624576/240b0137-1e9e-4e65-8446-0f78df9802dd)
- `hfrag` texture anim is not handled yet. Probably needs some special
casing.
2024-07-15 02:25:18 +02:00
Tyler Wilding 73ff53f01d
debugging: Improve event profiler utility (#3561)
- Can make the event buffer larger or smaller
- UI shows the current event index / size, so you know how fast it's
filling up
- Can save compressed, 10x reduction in filesize and Windows 11 explorer
actually supports ZSTD natively now so this isn't inconvenient at all

![Screenshot 2024-06-22
000343](https://github.com/open-goal/jak-project/assets/13153231/2f7dfa41-d931-4170-a848-840cbed9be9f)
> An example of almost 1 million events.  Results in a 4mb file.
2024-06-22 22:01:33 -04:00
ManDude 37762c5fb7
wrap sprite rgba to 0-255 (#3549) 2024-06-04 07:57:52 +01:00
Hat Kid c64eea6337
[buildactor] support generating collide-meshes for custom models (#3540)
This adds support for generating collide meshes when importing custom
models. A couple of things to keep in mind:

- A single `collide-mesh` may only have up to 255 vertices.
- When exporting a GLTF file in Blender, a `collide-mesh` will be
generated for every mesh object that has collision properties applied
(ideally, you would set all visual meshes to `ignore` and your collision
meshes to `invisible` in the OpenGOAL plugin's custom properties).
- Ensure that your actor using the model properly allocates enough
`collide-shape-prim-mesh`es for each `collide-mesh` ([example from the
original game that uses multiple
meshes](f6688659f2/goal_src/jak1/levels/finalboss/robotboss.gc (L2628-L2806))).

~One annoying problem that I haven't fully figured out yet (unrelated to
the actual functionality):
`collide-mesh`es are stored in art groups as an `(array collide-mesh)`
in the `art-joint-geo`'s `extra`, so I had to add a new `Res` type to
support this. The way that `array`s are stored in `res-lump`s is a bit
of a hack right now. The lump only stores a pointer to the array, so the
size of that is 4 bytes, but because we have to generate all the actual
array data too, the current `ResLump` code in C++ doesn't handle this
case well and would assert, so I decided to omit the asserts if an
`array` tag is present and "fake" the size so the object file is
generated more closely to how the game expects it until we figure out
something better.~
This was fixed by generating the array data beforehand and creating a
`ResRef` class that takes the pointer to the array data and adds it to
the lump.
2024-05-29 06:09:20 +02:00
ManDude dd765b41cb
jak 3 shadows (#3530)
![image](https://github.com/open-goal/jak-project/assets/7569514/e48dbbb8-82d9-4b9d-8ae4-3f48f7c35ced)
2024-05-23 18:29:42 +01:00
water111 271007e552
Start setting up texture animation for jak 3. (#3524)
For now, this just adds sky (clouds and fog), darkjak, and skull gem.

There are some unknown issues with drawing the skull gems still, but I
think it's unrelated to texture animations.

Also fixes https://github.com/open-goal/jak-project/issues/3523
2024-05-18 11:23:48 -04:00
ManDude ebbbedabc5
jak3: fix hud sprite crash + add entity debugger (#3516) 2024-05-13 04:09:25 +01:00
water111 e0b1d8c21e
Jak3 sky (#3514) 2024-05-12 09:36:50 -04:00
Hat Kid 4dd2bab06e
jak3: fix local space particle info crash (#3511) 2024-05-10 16:14:50 +02:00
water111 5b04be2fa0
Add hfrag, clean up some background renderer stuff (#3509)
This adds hfrag, but with a few remaining issues:
- The textures aren't animated. Instead, it just uses one texture.
- The texture filtering isn't as good as at it could be.

I also cleaned up a few issues with the background renderers:
- Cleaned up some stuff that is common to hfrag, tie, tfrag, shrub
- Moved time-of-day color packing stuff to FR3 creation, rather than at
level load. This appears to reduce the frame time spikes when a level is
first drawn by about 5 or 6 ms in big levels.
- Cleaned up the x86 specific stuff used in time of day. Now there's
only one place where we have an `ifdef`, rather than spreading it all
over the rendering code.
2024-05-09 20:11:43 -04:00
water111 807ca7465f
fix c++ compiler warnings, extract_merc assert (#3488)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2024-05-03 17:29:18 +01:00
ManDude cf79ca04e9
fix another jak 1 level name (#3503) 2024-05-03 08:34:36 +01:00
ManDude 8344ac6963
use only the real level name in the Loader (#3495)
This fixes issues with certain Jak 3 levels not rendering because there
is a mismatch between the DGO name, nickname and real level name (bsp
name).

FR3s use a different filename, so you can delete the ones you have after
this is merged.

This affects custom levels, but I don't have that toolchain set up so
someone else will have to test that.
2024-04-30 17:12:57 +01:00
Tyler Wilding a021c392ec
game: allow overriding the config directory location (#3477)
This is primarily driven for proper mod-support. Mods would like to
isolate their settings and saves (potentially) and that is currently
done by find-and-replacing code before building. Bad!

Additionally, this has the side-effect of allowing for portable
installations of the game so, win-win.

Testing in progress, i'll merge once it is ready.
2024-04-28 15:29:20 -04:00
Hat Kid e2e5289788
decomp3: font widescreen and shadow hacks, generic renderer, misc files (#3483)
- `pecker-ingame`
- `des-bbush-tasks`
- `des-burning-bush`
- `des-bush-part`
- `des-bush`
- `mh-centipede`
- `mh-centipede-part`
- `mh-wasp`
- `mh-wasp-part`
- `needle-fish`
- `des-bush-time-chase`
- `timer-path`
- `mission-squad-control-h`
- `mh-bat`
- `hover-nav-factoryd`
- `hover-nav-factoryc`
- `conveyor`
- `fac-part`
- `factory-part`
- `factoryc-mood`
- `factoryc-obs`
- `factoryc-obs2`
- `lfaccar-init`
- `factory-boss-part`
- `factory-boss-scenes`
- `factory-boss-setup`
- `factory-boss-states`
- `factory-mood`
- `factoryc-manager`
- `lfacrm1-mood`
- `lfacrm2-mood`
- `missile-bot`
- `sew-laser-turret`
- `ai-task-h`
- `ash-h`
- `ash-shot`
- `ash-states`
- `ash-task`
- `ash`
- `bot-h`
- `bot-states`
- `bot`
- `ash-oasis-course`
- `oasis-defense`
- `comb-field`
- `comb-mood`
- `comb-obs`
- `comb-part`
- `comb-scenes`
- `comb-sentry`
- `comb-travel`
- `comba-init`
- `combx-scenes`
- `h-sled`
- `destroy-dark-eco`
- `fac-gunturret`
- `fac-robotank-turret`
- `fac-robotank`
- `fac-tower`
- `factory-h`
- `factory-hud`
- `factory-manager`
- `factorya-init`
- `ffight-projectile`
- `ftank-projectile`
- `fturret-projectile`
- `h-warf`
- `warf-projectile`
2024-04-28 08:59:46 -04:00
ManDude 667553850d
jak2/3: re-implement screenshot system through goal (#3482) 2024-04-25 01:46:18 +01:00
Hat Kid 58a5440c8a
decomp3: more misc files (#3466)
Makes a bunch of missions mostly playable, including:
- `arena-training-1`
- `arena-fight-1`
- `wascity-chase`
- `arena-fight-2`
- `arena-fight-3`
- `volcano-darkeco`
- `desert-hover`
- `nest-eggs`
- `temple-climb`
- `temple-oracle`
- `temple-tests`
- `desert-beast-battle`
- `desert-turtle-training`
- `desert-course-race`
- `desert-artifact-race1`
- `wascity-leaper-race`
- `wascity-pre-game`
- `sewer-met-hum`
- `forest-kill-plants`
- `forest-ring-chase`
- `temple-defend`
- `tower-destroy`
- `desert-glide`

---
Files:

- `ripple`
- `waswide-mood`
- `sig-rider`
- `nst-tasks`
- `nst-part`
- `nst-gas`
- `nst-eggs-h`
- `nst-obs`
- `nst-mood`
- `egg-spider`
- `wasdoors-init`
- `wasall-tasks`
- `wvehicle-race`
- `wcar-marauder`
- `wcar-marauder-b`
- `turret-control`
- `was-squad-control`
- `turtle-training`
- `kleever-rider`
- `course-race`
- `artifact-race`
- `desert-hover`
- `desbeast-path-h`
- `des-beast`
- `desertg-obs`
- `desertf-obs`
- `desertd-obs`
- `desert-dust-storm`
- `des-cactus`
- `race-hud`
- `race-info`
- `race-manager`
- `tizard`
- `flyingsaw`
- `hover-training`
- `temple-mood`
- `temple-obs`
- `temple-obs2`
- `temple-part`
- `temple-scenes`
- `templex-mood`
- `templex-obs`
- `templex-part`
- `tomb-baby-spider`
- `target-turret-shot`
- `target-turret`
- `beast-battle-path`
- `des-beast-2`
- `mh-flyer`
- `scorpion-gun`
- `hover-enemy-h`
- `hover-enemy`
- `hover-formation-h`
- `hover-formation`
- `hover-nav-control-h`
- `hover-nav-control`
- `flamer-hover`
- `hover-nav-templea`
- `robo-hover`
- `hover-nav-sewb`
- `hover-nav-sewg`
- `hover-nav-sewj`
- `hover-nav-sewl`
- `hover-nav-sewo`
- `hover-nav-towera`
- `tower-mood`
- `tower-obs`
- `tower-scenes`
- `tower-part`
- `eco-green-collider`
- `forest-bridges`
- `forest-kill-plants`
- `forest-mood`
- `forest-ring-chase`
- `forest-tasks`
- `forest-part`
- `foresta-obs`
- `hover-nav-foresta`
- `mh-plant`
- `dp-bipedal-part`
- `dp-bipedal-shot`
- `dp-bipedal`
- `neo-spawner`
- `for-turret`
- `for-turret-shot`
- `neo-wasp`
- `neo-wasp-part`
- `volcanox-scenes`
- `volcanox-mood`
- `volcano-scenes`
- `volcano-mood`
- `volcano-obs`
- `volcano-obs2`
- `chain-physics`
- `rigid-body-plat`
- `volcano-part`
- `flamer-lava`
- `flitter`
- `spiky-frog`
- `flut-wild`
- `target-indax`
- `target-indax-hang`
- `mantis`
- `volcanox-obs`
- `spyder`
- `wcar-faccar`
- `mhcity-obs2`
- `mhcity-part`
- `mhcity-obs`
- `dm-mine-spider`
- `rapid-gunner`
- `stadium-mood`
- `stadium-scenes`
- `stadiuma-mood`
- `stadiuma-part`
- `kanga-lizard`
- `marauder`
- `arena-scenes`
- `wasstada-mood`
- `wasstada-obs`
- `wasstada-part`
- `wasstadb-obs`
- `wasstadc-obs`
- `dm-flyer`
- `maker-part`
- `maker-projectile`
- `skeet-part`
- `wascity-turret`
- `wasgun-h`
- `wasgun-hud`
- `wasgun-manager`
- `nav-graph-h`
- `traffic-engine-h`
- `waswide-init`
- `cty-borrow-manager-h`
- `cty-borrow-manager`
- `desert-part`
- `height-map-h`
- `height-map`
- `traffic-height-map`
- `vehicle-control`
- `hvehicle-h`
- `hvehicle`
- `hvehicle-effects`
- `hvehicle-physics`
- `hvehicle-util`
- `glider-h`
- `glider-hud`
- `glider-manager`
- `glider-ring`
- `glider-ring-part`
- `h-glider`
- `hanga-init`
- `was-pre-game`
- `was-leaper-race`
- `flut-racer`
- `desert-scenes`
- `desert-lizard-h`
- `desert-lizard-task`
- `desert-lizard`
- `throne-scenes`
- `waspal-mood`
- `waspala-obs`
- `waspala-part`
- `deswalk-obs`
- `deswalk-part`
- `terraformer-drone`
- `terraformer-head`
- `terraformer-part`
- `terraformer-setup`
2024-04-22 18:43:51 +02:00
ManDude 8e5830321c
[jak3] fix process stack overflow + collision renderer (#3473) 2024-04-16 04:26:01 +01:00
ManDude 20b76e318d
[jak3] remove some stubs and fix health bar (#3468) 2024-04-15 16:24:29 +01:00
water111 dd4f255260
[jak3] Minimap texture fix (#3465) 2024-04-13 09:47:23 -04:00
Hat Kid 36f1592b90
decomp3: lightning renderer, nav code, texture remap, fix progress menu crash (#3461)
Also adds:

- BLERC
- Minimap (with missing texture for the map, sprites work)
- Eco Mine files
- Precursor robot boss files
- Sewer files
- Vehicle files
2024-04-12 18:44:38 -04:00
water111 5299bc441f
[jak3] Fix defskelgroup (#3460)
Fixes https://github.com/open-goal/jak-project/issues/3459
2024-04-07 13:07:30 -04:00
Hat Kid ae0f139667
decomp3: eye renderer and more files (#3457)
- `eye`
- `collision-editor`
- `simple-nav-sphere`
- `mech-part`
- `mech-states`
- `mech`
- `target-mech`
- `target-tube`
- `flut-part`
- `flut`
- `target-flut`
2024-04-07 10:49:45 -04:00
water111 376194a3e7
Jak 3, fixes for animation issues, rm debug print (#3453) 2024-04-06 15:09:02 -04:00
Hat Kid 23aeda1664
decomp3: add background data to pc renderers, get mood and time of day stuff running (#3450) 2024-04-06 14:27:36 -04:00
Hat Kid 93afb02cf4
decomp3: spawn target, add merc and particle buckets and some temporary hacks (#3445)
This includes all the collision stuff needed to spawn `target`,
decompiles the sparticle code and adds some of the PC hacks needed for
merc to run (it doesn't work quite right and looks bad, likely due to a
combination of code copied from Jak 2 and the time of day hacks).

There are a bunch of temporary hacks (see commits) in place to prevent
the game from crashing quite as much, but it is still extremely prone to
doing so due to lots of missing functions/potentially bad decomp.

---------

Co-authored-by: water <awaterford111445@gmail.com>
2024-04-05 00:07:39 -04:00
Hat Kid dacb704ef6
decomp3: more engine stuff, fix ja macro detection for jak 2/3, unmerged let matcher, part-tracker-spawn macro (#3436)
- `aligner`
- `effect-control`
- `pov-camera`
- `powerups`
- `los-control-h`
- `airlock`
- `water-anim`
- `blocking-plane`
- `proc-focusable-spawner`
- `idle-control`
- `enemy-h`
- `nav-enemy-h`
- `enemy`
- `enemy-states`
- `particle-curves`
- `base-plat`
- `plat`
- `bouncer`
- `elevator`
- `rigid-body`
- `rigid-body-queue`
- `process-taskable`
- `scene-actor`
- `warp-gate`
- `guard-projectile`
- `metalhead-projectile`
- `los-control`
- `joint-exploder`
- `ragdoll-test`
- `debris`
- `shield-sphere`
- `text`
- `target-launch`
2024-03-30 10:28:02 -04:00
water111 9b4b54978a
decomp drawable, main (#3434) 2024-03-24 12:27:04 -04:00
water111 390a511055
[jak3] Decompile sprite (#3412)
Decompile `sprite.gc`. Also update the DMA macro for a small change in
Jak 3: a check to see if nothing was added to the bucket.
2024-03-09 12:14:12 -05:00
Tyler Wilding 60db0e5ef9
deps: update fmt to latest version (#3403)
This updates `fmt` to the latest version and moves to just being a copy
of their repo to make updating easier (no editing their cmake / figuring
out which files to minimally include).

The motivation for this is now that we switched to C++ 20, there were a
ton of deprecated function usages that is going away in future compiler
versions. This gets rid of all those warnings.
2024-03-05 22:11:52 -05:00
Tyler Wilding d1a6c60eb8
game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295)
It was narrowed down recently that a lot of people have issues with the
controller input because of Steam Input working as intended. Steam Input
can be configured to replicate controller inputs as keyboard inputs (for
example, pressing X on your controller presses Enter on the keyboard).

This results in the problem of "jumping pauses the game" and similar
issues. This is a consequence of the intended behaviour of the game
listening to all input sources at the same time.

Since the vast majority of players are using controllers over keyboards,
it makes sense to disable the keyboard input by default to solve this
problem. However that makes things awkward for users that want to use
the keyboard (how do they enable the setting). The solution is a new
imgui option in the settings menu:
![Screenshot 2024-01-07
141224](https://github.com/open-goal/jak-project/assets/13153231/6f9ffa2d-be7a-433d-b698-15b70210e97e)

**Known issue that I don't care about** -- in Jak 1's menu code, since
the flags are controlled by pointers to values instead of a lambda like
in jak 2, the menu won't update live with the imgui option. This has no
functional impact and I don't care enough to fix it.

I also made the pc-settings.gc file persist on first load if the file
wasn't found. Hopefully this helps diagnose the support issues related
to the black screen.

# Why not just ignore the keyboard inputs for a period of time?

This won't work, the keyboard is polled every frame. Therefore if you
hold down the X button on your controller, steam is continuously
signaling that `Enter` is held down on the keyboard.

Yes it would be possible to completely disable the keyboard while the
controller is being used, but this defeats the purpose of creating an
input system that allows multiple input sources at the same time.

With an explicit option, not only can the user decide the behaviour they
want (do they want the keyboard ignored or simultaneously listened to)
but we avoid breaking strange edge-cases in usage leading to never
ending complexity:
- ie. imagine steam input sends events to the mouse, well you can't
disable the mouse while using the keyboard because most times people are
using mouse and keyboard
- ie. a user that wants to hold a direction with the keyboard and press
buttons on the controller in tandem (something i frequently do while
TAS'ing, to move in a perfect straight line)
2024-02-23 18:19:07 -05:00
Tyler Wilding 1cc20508e9
tracing: add some more startup related events and a new --profile-until-event flag (#3385)
While trying to narrow down why sometimes SDL takes 20-40seconds to
initialize I built up some more profiling features.

TLDR - I still don't know why SDL is taking a long time but I've
narrowed it down to it initializing the `GAME_CONTROLLER` subsystem.
This isn't unprecedented, I found numerous github issues and articles
suggesting this is the problem:

![image](https://github.com/open-goal/jak-project/assets/13153231/1853326b-7a40-458e-87a0-f7a9f44781e3)

I imagine it is hardware/OS related on some level, there are even some
recent commits in SDL that have made it worse on certain platforms. I've
had this problem myself so I will hope to get it again soon so i can
debug where in the SDL code the delay occurs and make a proper bug
report. Hopefully this helps but it's not yet confirmed -
https://github.com/open-goal/jak-project/pull/3384
2024-02-23 14:44:17 -05:00
Tyler Wilding 94585e7f87
game: fix intermittent sprite_distort related crash (#3357)
Apparently a long standing bug, with
https://github.com/open-goal/jak-project/pull/3194 making it more likely
to occur.
2024-02-02 17:51:21 -05:00
ManDude d67b441dac
Change important printfs to lg::print (#3355)
This allows them to be logged into a file, useful for debugging.

With this, GOAL `format` and C-kernel `Msg` (and its variants) will be
logged.
2024-02-01 18:01:41 +00:00
ManDude 9aa291313b
fix custom screenshots and change screenshot directory (#3339) 2024-01-26 04:49:35 +00:00