Commit graph

804 commits

Author SHA1 Message Date
Hat Kid 1d868a2bd9
decomp: kor-*|kid-*|widow-*|hal-*|atoll-* files, spyder, sniper, juicer and more (#2134)
Full list:

- `atoll-obs`
- `atoll-tank`
- `juicer`
- `sniper`
- `transport`
- `yakow`
- `kid-h`
- `kid-states`
- `kid-task`
- `kid3-course`
- `kid`
- `kor-h`
- `kor-states`
- `kor-task`
- `kor3-course`
- `kor`
- `spyder`
- `spydroid`
- `widow-baron`
- `widow-extras`
- `widow-more-extras`
- `widow2`
- `widow`
- `flying-spider`
- `mammoth`
- `mantis`
- `nest-obs`
- `hal-task`
- `hal`
- `hal3-course`

Manual patches:
- `widow`: `handle->process` stack var
- `nestb-scenes`: Commented out `nav-network` stuff, was causing crashes
in `nest`

Also fixes `ginsu` crash (`blade-part` had the wrong type)
2023-01-21 19:50:48 -05:00
Hat Kid 9889b638b3
jak2: tomb fixes (#2137) 2023-01-17 03:18:01 +01:00
water111 7d7625f4f8
[jak2] workaround for cutscene playing (#2131) 2023-01-16 13:37:29 -05:00
Luminar Light 7fdef1c509
Fix 'Load... border-mode' in default-menu (#2132)
This one was forgotten when the other similar menu entries were fixed.
So I fixed this now.
2023-01-16 13:37:16 -05:00
Tyler Wilding dd0a8a17b2
docs - first chunk of work documenting the files I glossed over (#2130)
- started documenting the files I glossed over, some are totally done,
others are just partially done
- I changed the decompiler to automatically initialize the
art-group-info from the json file. This makes updating gsrc, even a
single file at a time, have consistent naming
- Though I disabled this functionality for jak 1, as I have no idea if
using the ntsc art groups will cause a regression for different versions
- fix indentation for docstrings -- it still doesn't look great, but
this is now a formatting concern, rather than the docstring having a
bunch of happen-stance leading whitespace.
2023-01-15 11:33:39 -05:00
water111 a0d2bce27b
Minor bug fixes (#2128)
- make sure bsp is processed on `l` levels in extraction (caused missing
remaps)
- clean up a few prints in extraction
- handle the <15 byte differences in art group files automatically (no
more errors about file naming)
- fix potential exception thrown by merc2 in a few ways: fixed bad data
in FR3's, check texture index just in case, and handle exceptions a
little bit better (still a crash, but at least you get a print)
- fix mips2 ocean stuff causing ocean far crashes
2023-01-14 16:26:17 -05:00
Hat Kid 8a82c2225e
decomp: ai-task-h, whack, bot, sig, ash files (#2127)
`whack` is missing a single function (`birth-func-whack-score`) that I
couldn't figure out the right args for.

I was not able to test any of this code because I cannot get `atoll` to
extract.
2023-01-14 16:12:03 -05:00
Hat Kid 459d83f755
decomp: tomb-* files, target-indax, grunt-mech, breakable-wall, pillar-collapse, mechtest-obs, ruins-obs (#2114)
Manual patches in:

- `tomb-boulder`: a few `ppointer->handle`s (I think) were not being
decompiled properly (all used in combination with `clone-anim-once`)
- `ruins-obs`, `pillar-collapse`: `art-joint-anim` casts
- `tomb-beetle`: commented out a call to `shadow-control-method-14` that
was crashing the game when spawning the beetles
- `grunt-mech`: commented out `(.mula.s)` instruction

Notes:
- `enemy-info`'s `idle-anim-script` is most likely a `(pointer
idle-control-frame)`, however, some `nav-enemy-info` labels set it to
`#f` (first encountered in `tomb-beetle`, but also present in `hal`,
`roboguard` and `metalkor-setup`), which crashes the decompiler. This
may become a problem in the future when we eventually get to these
files. For this PR, I made `tomb-beetle` decompile with
`idle-anim-script` set to `#f` and have not noticed any issues/crashes
with that.
- `tomb-boulder` compiles and doesn't crash, but when trying to play the
Daxter chase sequence, the boulder sometimes either spawns at the origin
or spawns in the correct place, but doesn't move.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 13:53:31 -05:00
Tyler Wilding b072126764
d/jak2: some minor fixes and workarounds to make debugging easier (#2116)
- worked around audio code for gungame, the tutorials now function
- auto-exit cutscenes upon entry. This doesn't always work nicely (i
didnt want to cause any side-effects due to messing with load states)
but it atleast stops jak from being stuck forever waiting for the
cutscene to load
2023-01-14 12:36:41 -05:00
Tyler Wilding 8b12553d15
d/jak2: first pass at decompiling the core vehicle/traffic code (#2058)
Effects the following files:
- [x] vehicle-rider
- [x] vehicle-control
- [x] vehicle-effects
- [x] vehicle
~~- [ ] vehicle-util~~
- [x] vehicle-physics
- [x] vehicle-states
~~- [ ] vehicle-guard~~
~~- [ ] traffic-engine~~
~~- [ ] traffic-manager~~

With the exception of traffic-engine, most of these files are either
done or have 1-3 stubborn functions remaining. Draft while I try to
resolve as many as possible / cleanup names and such.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 12:01:33 -05:00
Tyler Wilding d6f9af7a20
d/jak2: finish strip mine files (#2111)
The level crashes similarly to drill-platform though, unclear what is
the root cause of it.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 11:30:58 -05:00
Tyler Wilding 88c39217e1
d/jak2: finish the remaining mountain temple related files (#2110)
There's some minor issues remaining, almost all of which pertain to
cutscene playing though.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 11:16:53 -05:00
water111 d65a1c365a
some bug fixes (#2125) 2023-01-14 11:04:15 -05:00
Tyler Wilding a75f4c187b
d/jak2: mostly complete sewer-enemy and sewer-board missions (#2108)
Finishes the following files:
- `sewer-scenes`
- `sewgun-turret`
- `fordumpc-part`
- `sewer-obs`
- `sewer-obs2`
- `gator`

Fixes #2052
2023-01-14 10:54:39 -05:00
Inirdin fa0f386bf0
Font colors comments (#2122) 2023-01-13 14:02:47 -05:00
water111 cb8cafa40a
[decomp] minimap (#2118) 2023-01-11 19:42:39 -05:00
Tyler Wilding f162d5ac31
d/jak2: finish wren and fish (#2106)
finish the forest's ambiance
2023-01-11 19:24:44 -05:00
water111 8dedfb682e
dig obs small fix (#2119)
was already right, goal src just needed updating.
2023-01-11 19:09:48 -05:00
Tyler Wilding e0d31a33bd
d/jak2 - initial crimson-guard-level decomp and also the dig missions (#2092)
Finishes a bunch of files related to crimson guards / early missions:
- `crimson-guard-level`
- `dig-digger`
- `fordumpa-obs`
- `fort-robotank`
- `fort-robotank-turret`
- `fort-turret`
- `transport-level`
- `fordumpb-obs`
- `fort-floor-spike`
- `fordumpc-obs`
2023-01-11 19:07:35 -05:00
EvelynTSMG 22adecc222
Make jungle mirrors respect first person camera settings (#2112)
QoL, I suppose
2023-01-11 18:16:27 -05:00
Hat Kid bdee98323d
decomp: add a bunch of enemy files (#2101)
Adds the following files:

- `amphibian`
- `centurion`
- `ginsu`
- `grenadier`
- `hopper`
- `metalmonk`
- `monster-frog`
- `predator-graph`
- `predator-h`
- `predator`
- `rapid-gunner`
- `rhino`
- `rhino-wall`
- `tomb-baby-spider`

Also adds the DGOs for the following levels:

- Mar's Tomb
- Mountain Temple
- Drill Platform
- Sacred Site (Sage Hut)

Manual patches:

- The decompiler emits `(b! #t cfg-17)` in `(trans hostile hopper)`
without putting a `(label cfg-17)` anywhere
- Added cast to `art-joint-anim` in `(code broken rhino-wall)` and
`(code hit rhino-wall)`

Other notes:

- `amphibian` seems to occasionally crash when using its tongue attack.
Haven't investigated this yet
- `ginsu` crashes after being killed somewhere in the `deactivate`
method, possibly because of its `part-spawner`
- Predators aren't spawning in the forest hunt mission, not sure if
`forest-obs` might be needed for that or if it's something else
- The `rhino-wall` STR animation seems to load (albeit a bit broken due
to missing VAG stream playback), but causes the viewport to shrink as
soon as it's played
- I added `pegasus::74` to the `event_handler_hack` bool in
`variable_naming.cpp` because I got a `none` cast after changing the
return value of `enemy::74`
2023-01-07 17:14:12 -05:00
Tyler Wilding 00ac12094e
goalc/repl: cleanup of goalc/REPL code and some QoL improvements (#2104)
- lets you split up your `startup.gc` file into two sections
  - one that runs on initial startup / reloads
  - the other that runs when you listen to a target
- allows for customization of the keybinds added a month or so ago
- removes a useless flag (--startup-cmd) and marks others for
deprecation.
- added another help prompt that lists all the keybinds and what they do

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-07 11:24:02 -05:00
Tyler Wilding f699675ede
g/jak2: initial Discord RPC implementation (#2100)
Notable things:
- This assert is hit when trying to save the pc-settings file, NYI
e630b50690/game/kernel/common/Symbol4.h (L14)
so right now settings aren't persisted. But RPC defaults to on
- The existing functions can probably be made generic based off the game
version, but I didn't spend time refactoring them yet as they aren't
really ready to be used in jak 2 yet (we have no screenshots for the
levels for example)
2023-01-07 10:34:01 -05:00
water111 f50c0e56e9
[jak2] use art constants (#2097) 2023-01-07 10:32:03 -05:00
Tyler Wilding 5095b867b0
d/jak2: finish jetboard training mission (mostly) and scouts mission (#2090)
The things that aren't working right now:
- returning the board (maybe cutscene related?)
  - draft until i see if this can be sorted out
- seems to need streaming audio as well, the `scene-player` gets
properly initialized from what i can tell
- had to hack around the streaming audio parts.
2023-01-04 20:43:34 -05:00
Hat Kid 09d555b4a0
decomp: mech, mech-states, target-mech (#2091)
Everything relating to IK in `target-mech` was commented out as I
couldn't get a lambda to decompile properly, but the mech still seems to
work fine without it.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-04 19:42:26 -05:00
Ziemas f0ca0cbe6a
Overlord: mirror sound RPC command (#2094)
And replace the previous mechanism for mirroring the sound.
2023-01-04 18:22:18 -05:00
ManDude 15a8a9c8ef
add ja zero func (#2074)
fixes #2071
2023-01-02 18:23:33 +00:00
water111 77a3e4125c
[jak2] don't ignore disable-draw bits (#2089)
Same idea as what I did for jak 1, but now there's a mask that can be
set by the user. It's used on the gun course dummies, for example.
2023-01-02 13:09:30 -05:00
water111 20a6839e07
[jak2] fix hud and some particles (#2088)
Fixes:
- a very old bug in depth in DirectRenderer, probably from the original
tfrag stuff. Looked at PCSX2 source code to see how 32/24 bit depths are
handled. This fixes hud sprites being drawn behind level geometry.
- saturate `vftoi4` like the ps2 does when the float is too large,
fixing hidden text in `hud`. For now it's only using this in the font
code because this saturation is actually kinda slow and hasn't been a
problem in other places.
- fix crazy particle spawning issue with blue gun and dripping stuff.
This would happen if particles kill themselves while being processed
(through a callback)
2023-01-02 12:13:19 -05:00
water111 0e43c96e52
[decomp] hud, hud-classes, add some new basic alignment options, fix type bug (#2084) 2023-01-02 10:05:22 -05:00
Tyler Wilding 9f53edae7a
game/debugging: Add a new imgui menu to filter debug text and adjust imgui config settings (#2085)
This adds a new ImGUI menu to help filter out the clutter on screen.


https://user-images.githubusercontent.com/13153231/210192912-b1c28319-bacb-449c-ad7f-e7308fb75f50.mp4

This also:
- moves the imgui display bool into a game specific config file (you can
hide it in jak1, and not in jak2)
- the config file also persists the settings from this menu (except the
filters for now, future TODO)
- there is a new `ignore_imgui_hide_keybind` in this file to ignore
hiding it when you press Alt
2023-01-02 09:45:38 -05:00
Tyler Wilding f06fd9b9c5
lint: remove some debugging logs (#2086) 2023-01-02 01:11:05 -05:00
Tyler Wilding 284fb09997
d/jak2: decompile fodder and nav-enemy (#2080)
fixes #1983 

First functioning enemy!


https://user-images.githubusercontent.com/13153231/210184845-f1d93491-11f5-4a64-b69c-41e535992ebc.mp4
2023-01-01 21:03:07 -05:00
water111 308038a20f
[decomp] collectables, fix float bug in a few files (#2082)
Fixes https://github.com/open-goal/jak-project/issues/1931
Also decompile collectables.gc
2023-01-01 18:05:31 -05:00
Tyler Wilding 5333aa3fb2
d/jak2: finish decompiling gungame files and tomb-scenes (#2076) 2023-01-01 16:22:44 -05:00
water111 0cddf6b6a5
W/nav debugging (#2077)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-01 12:11:18 -05:00
Tyler Wilding 6aa15c897f
decomp: don't mutate allowed/banned object lists (#2073)
oops, leads to some very confusing behaviour
2022-12-30 23:57:01 -05:00
water111 602765db6e
[decomp] drawable, memory-usage (#2070) 2022-12-30 18:23:53 -05:00
Tyler Wilding 6406ba05a6
d/jak2: finish atoll-scenes (#2069) 2022-12-30 18:23:45 -05:00
water111 d454dfbcd8
add target-board-handler (#2068) 2022-12-30 15:23:46 -05:00
water111 f6c5504f6f
[decomp] fix up gun decomp (#2067)
I did some manual modifications in a few places to work around some
truly mysterious control flow, and some unsupported stack array stuff.

Also fixes a bug in decompiling static improper lists.

As far as I can tell, guns work, other than some graphical issues and
the crazy particle spawning issue, but I strongly suspect these are
problems with the sparticle/graphics side.
2022-12-30 14:07:32 -05:00
water111 e49e6548e0
[jak2] split up big dgos, some minor cleanup (#2066)
- Split up DGOs between threads in the multithreaded offline test
- fix some random warnings
- make the sig paths decompile a bit nicer to make some files smaller
2022-12-30 13:33:29 -05:00
Tyler Wilding 2eca614870
d/jak2: finish remaining *-h files that aren't in progress or spoken for (#2059)
This finishes off all the remaining "header" files that someone isn't
already working on.
2022-12-30 12:09:04 -05:00
Tyler Wilding fb11c162c1
jak1: fix debug menu regression around lambdas (#2065) 2022-12-27 23:04:26 -05:00
Hat Kid 98c2291102
jak2: misc fixes (#2050)
- Stub `target-board-handler` to prevent jetboard crash
- Increase stack size for `target` to fix dark bomb crash
- Uncomment some code in `target-darkjak` to make Dark Jak work (texture
morph still crashes, so it's commented out)
- Increase stack size for a `process-spawn-function` in
`target-send-attack` to fix a crash with giant Dark Jak
2022-12-22 13:59:24 -05:00
Tyler Wilding 1b2db09f51
d/jak2: pass through all simple / non-blocked *-part, *-ocean and *-scenes files (#2048)
A big one...

I figure even if we would like to change the way the particle/scene code
is output -- it'd be easier to find patterns with it all decompiled.

I've updated my script so it can easily be used to mass update these
files:
```bash
task update-gsrc-glob GLOB="**/*-part*.gc"
```
> for example will update gsrc files with `part` in their name -- if
they are in ref tests (so uncompleted ones aren't touched)

I found a few issues along the way that I'll have to make issues for
soon.
2022-12-22 13:57:57 -05:00
Ziemas 5b99929394
989snd: Support version >= 2 sound effects (#1991)
Supports most of the grain types now while maintaining compatibility
with the old stuff (at least the subset of things jak1 uses)

Would benefit from some testing in Jak 1 to make sure I didn't break
anything.

Sorry the git history is a mess, I'll do something about it later.
2022-12-02 18:08:44 -05:00
water111 80e9528e4e
lights, death, and rotation fix (#2042)
- decompile `lights.gc`
- decompile remaining `target-death` function, you can die now
- fix float issue with `matrix-from-two-vectors-smooth!` making jak face
the wrong way in the slide thing
2022-12-02 10:02:13 -05:00
Tyler Wilding 728b2689b6
d/jak2: decomp a bunch of files related to the beginning of the game (#2043)
Mostly easy / particle def files. I did a bit in `ruins` but CFG
failures and missing `drawable` functions make it untestable for now so
I've put that on pause.
2022-12-01 21:26:49 -05:00