Commit graph

1856 commits

Author SHA1 Message Date
ManDude ad9a532ff9
[jak2] text aspect ratio fixes (#2251)
Fixes the aspect ratio of the font renderer (Jak 2 does not need the
same hacks as Jak 1), the custom letterbox/pillarbox sizes and fixes the
heap display.

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-25 19:27:58 +00:00
water111 909da024fc
[decomp] ctywide-obs (#2250)
finish this up
2023-02-25 14:00:16 -05:00
ManDude 4b8b2abbed
port pckernel to Jak 2 (#2248)
Adds the `pckernel` system to Jak 2, allowing you to do the PC-specific
things that Jak 1 lets you do like change game resolution, etc.

In other to reduce the amount of code duplication for something that
we're gonna be changing a lot over time, I split it into a few more code
files. In this new system, `pckernel-h.gc`, `pckernel-common.gc`
(previously `pckernel.gc`) and `pc-debug-common.gc` are the files that
should be shared across all games (I hacked the Jak 2 project to pull
these files from the Jak 1 folder), while `pckernel-impl.gc`,
`pckernel.gc` and `pc-debug-methods.gc` are their respective
game-specific counterparts that should be loaded after. I'm not fully
happy with this, I think it's slightly messy, but it cleanly separates
code that should be game-specific and not accidentally copied around and
code that should be the same for all games anyway.
2023-02-25 10:19:32 -05:00
water111 e2b7e5c001
[goalc] reduce compiler memory usage (#2247) 2023-02-24 18:32:30 -05:00
Tyler Wilding e10ca97891
repl: prevent REPL crash when running (reload) (#2243)
Stops the REPL crashing with `device or resource busy` when running
`(reload)`

However I think this is indicative of a bigger problem where either the
`Compiler` or prompt is not ready to handle input immediately after
creation and setting the status to `OK`.
2023-02-24 18:04:10 -05:00
Matt Dallmeyer e89f0770dc
Fix Jak 2 warp gates (#2244) 2023-02-24 19:33:27 +01:00
Hat Kid 2d8ad39fea
jak2: add back some pc port debugging tools and add palace-scenes to gsrc (#2240)
Ports some of the custom PC port debugging code from Jak 1, such as the
entity debugger, Anim Tester X and part tester, to Jak 2 and gives the
PC menu code the same treatment Jak 1 received recently in #2216.
Some adjustments have been made to make things work in Jak 2 and some
stuff is still incomplete.
The majority of the default PC menu code has been left commented out in
preparation for @ManDude's plan to port the rest of the Jak 1 `pckernel`
features to Jak 2.

Also adds the code for `palace-scenes` to gsrc as that seems to have
been missed.
2023-02-23 21:39:02 +00:00
Dillon Pentz 66c680e8a3
[jak2] fix rare civilian flee crash (#2230)
Fixes a rare crash that can sometimes happen when civilians are picking
a direction to flee in, where a branch count may be 0, causing a divide
by 0 MATH_EXCEPTION.
2023-02-21 01:30:09 -05:00
Tyler Wilding a76f558537
ci: gen-docs propagate the runId since thats the best we can do (#2238) 2023-02-20 22:52:33 -05:00
Tyler Wilding 3c3d45d497
ci: set cmake preset in informing workflow (#2237) 2023-02-20 22:14:47 -05:00
water111 08ce65fd9b
[jak2] add sprite glow renderer (#2232)
Adds the "sprite glow" renderer, which is responsible for the glowing
lights.
2023-02-20 20:25:45 -05:00
Matt Dallmeyer f388898d7b
Speedrun verification text cleanup (#2229)
We only draw this text to the screen if we're in speedrunner mode
anyway, so the `#t` flag on this line doesn't really add any value imo

b130b2eac2/goal_src/jak1/pc/features/speedruns.gc (L248-L255)


![image](https://user-images.githubusercontent.com/2515356/220177466-4ecb8376-7953-4161-a6ca-a300b6978d3e.png)
2023-02-20 19:49:57 -05:00
Tyler Wilding 39658dfd71
docs: Automatically generate documentation from goal_src code (#2214)
This automatically generates documentation from goal_src docstrings,
think doxygen/java-docs/rust docs/etc. It mostly supports everything
already, but here are the following things that aren't yet complete:
- file descriptions
- high-level documentation to go along with this (think pure markdown
docs describing overall systems that would be co-located in goal_src for
organizational purposes)
- enums
- states
- std-lib functions (all have empty strings right now for docs anyway)

The job of the new `gen-docs` function is solely to generate a bunch of
JSON data which should give you everything you need to generate some
decent documentation (outputting markdown/html/pdf/etc). It is not it's
responsibility to do that nice formatting -- this is by design to
intentionally delegate that responsibility elsewhere. Side-note, this is
about 12-15MB of minified json for jak 2 so far :)

In our normal "goal_src has changed" action -- we will generate this
data, and the website can download it -- use the information to generate
the documentation at build time -- and it will be included in the site.
Likewise, if we wanted to include docs along with releases for offline
viewing, we could do so in a similar fashion (just write a formatting
script to generate said documentation).

Lastly this work somewhat paves the way for doing more interesting
things in the LSP like:
- whats the docstring for this symbol?
- autocompleting function arguments
- type checking function arguments
- where is this symbol defined?
- etc

Fixes #2215
2023-02-20 19:49:37 -05:00
OpenGOAL Bot 65f2146d73
CI: Periodic Controller Database Update (#2231)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-02-20 16:39:41 -05:00
Matt Dallmeyer b130b2eac2
Redundant (declare-file (debug)) (#2226)
Just noticed this while looking into #2225 , this line is repeated a few
lines later

b9cd17b20a/goal_src/jak1/engine/camera/cam-layout.gc (L8-L13)
2023-02-18 17:26:33 -05:00
water111 b9cd17b20a
[jak1] fix crash on startup (#2225) 2023-02-18 17:19:22 -05:00
Hat Kid d946a09a99
decomp: palcab-obs (#2222)
Co-authored-by: water <awaterford111445@gmail.com>
2023-02-18 15:59:34 -05:00
water111 b7cfd80b14
set up fog for jak 2 (#2223)
![image](https://user-images.githubusercontent.com/48171810/219878142-8ad7c154-9f52-4ad8-a315-1c932e24cd4b.png)
2023-02-18 15:45:13 -05:00
Hat Kid f452a504e6
decomp: race-* files (#2224) 2023-02-18 15:45:00 -05:00
OpenGOAL Bot 466ef6af3d
CI: Periodic Controller Database Update (#2217)
Updating Controller Database

Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-02-18 11:01:47 -05:00
Hat Kid d65d6233d9
decomp: kidesc-*|crocesc-* files, ash4-course (#2219)
Co-authored-by: water <awaterford111445@gmail.com>
2023-02-18 11:01:24 -05:00
Hat Kid 7a2575fd23
decomp: meet-brutter (#2218) 2023-02-18 10:30:29 -05:00
Matt Dallmeyer 4c812658f1
Easier combo for Speedrun Options (#2196)
Some people have complained about the button combo for entering the
speedrun menu, saying it's awkward to press Start.

This change lets you press Select instead (while holding L1+R1+X). The
old combo (pressing Start) still works as well.
2023-02-18 09:51:26 -05:00
ManDude ee3bc182e1
[jak1] force credits to use audio language instead of text language (#2220) 2023-02-14 20:12:45 +00:00
ManDude 324def1303
split new pc features in some files into their own code files + address some old issues + ripple graphics improvements (#2216)
Moves PC-specific entity and debug menu things to `entity-debug.gc` and
`default-menu-pc.gc` respectively and makes `(declare-file (debug))`
work as it should (no need to wrap the entire file in `(when
*debug-segment*` now!).

Also changes the DGO descriptor format so that it's less verbose. It
might break custom levels, but the format change is very simple so it
should not be difficult for anyone to update to the new format. Sadly,
you lose the completely useless ability to use DGO object names that
don't match the source file name. The horror!

I've also gone ahead and expanded the force envmap option to also force
the ripple effect to be active. I did not notice any performance or
visual drawbacks from this. Gets rid of some distracting LOD and some
water pools appearing super flat (and pitch back for dark eco).

Fixes #1424
2023-02-13 21:39:14 +00:00
water111 ed38adc2a7
[tie] support per-proto visibility flags (#2212)
Jak 2 adds a feature to disable protos in TIE. It's used to hide things
like steps for a future mission in ruins, and also to hide the static
version of the tower when it switches to the merc version for the
cutscene:


![image](https://user-images.githubusercontent.com/48171810/218270077-d8c52235-ddbf-4194-80f6-b8aa1eeeb7ec.png)
2023-02-11 12:00:05 -05:00
Hat Kid 7afa583bff
decomp: metalkor-* files (#2211)
Manual patches:

- `metalkor-egg-reaction`: Rewrote `(.mula.s)`

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-11 09:34:31 -05:00
Hat Kid 3f5898b5c2
decomp: castle-baron (#2208)
Manual patches:

`(trans idle krew-boss)`: `collide-shape` array created on the stack
changed to `(pointer collide-shape)`

---------

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-11 09:24:40 -05:00
Hat Kid cd655ea916
jak2: fix drill-eggs crash (#2209)
Closes #2210
2023-02-11 09:08:08 -05:00
water111 c249dbc437
[jak2] improve loader for jak 2 levels (#2206)
Add a debug window for the loader to show levels and fix an issue with
jak 2 level unloading. I never really thought about how this works for >
2 levels, and there is a chance that you could unload the wrong level in
some cases.

The problem is some combination of merc-only levels not counting toward
the "in use" detection, and the unloader ignoring what the game wants to
load.

I don't remember why using merc models doesn't contribute to "in use"
but I'm afraid to change this for jak 1. Instead, we can have the
unloader avoid unloading levels that the game is telling us are loaded.
This is what we should have done originally, but there was a time when
Jak 1 didn't tell the loader anything, and we had this stupid detection
thing.

I think this is the first step toward just getting rid of the "in use"
detection and trusting the game for everything.
2023-02-09 20:44:33 -05:00
water111 e41ca8903e
[jak2] fix alpha test in lightning (#2204)
fixes the lightning fade out effect seen when jak touches the electric
gate.
2023-02-09 19:51:28 -05:00
Tyler Wilding a02a75525d
CI: Periodic Controller Database Update (#2202)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-02-09 19:50:07 -05:00
water111 e26efcc4f3
[jak 2] add lightning renderer (#2203)
Implements the jak 2 lightning renderer as an alternate path through
Generic2. Also set up some generic stuff in the goal code.

There is a problem with the texture pool, which doesn't support the case
where two textures have the same tbp, but different cluts. So lightning
is often the wrong color (usually red).
2023-02-09 19:11:13 -05:00
Tyler Wilding 722ffa3f19
ci: switch to a pull request instead of a direct commit for updating controller db (#2201)
The direct commit option doesn't work as there is no way to bypass
required status checks -- this makes the merge queue less useful. Switch
to a PR instead.
2023-02-09 18:42:09 -05:00
Tyler Wilding 65812f722c
d/jak2: seal-at-waterslums working, and do a pass through all missions (#2199)
I did a pass through all missions, fixing issues as they came up. Also
got `seal-at-waterslums` working -- the best mission in the game 🥳

Co-authored-by: water <awaterford111445@gmail.com>
2023-02-09 18:40:01 -05:00
Hat Kid 67d4eda169
decomp: hover-* files, wasp, crimson-guard-hover, flamer, target-turret, drill-turret, jellyfish (#2198)
Manual patches:

- `drill-turret`: The static data for `*turret-13-path*`,
`*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the
integers in the `set-speed-mult` events have been replaced with boxed
integer arrays that contain only that integer in order to make the
compiler happy. To that effect, the event handler in `target-turret` was
changed to access that array instead of just accessing the int.
- `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a
`vector`, but there are some places where it is called with `#t` as
`arg2` and, subsequently, crashes the game because it tries to access
the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the
condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in
this case, it would jump to the `else` that just resets the `dest-vel`
and `transv` `quad`s)
- `drill-baron`: The static data for `*drill-ship-turret-speed-event*`
has been decompiled by hand.

TODOs:
- Jellyfish crash the game
- Destroying the metalhead eggs that are on the breakable wall crashes
the game (already happened with the Peacemaker before)
- Figure out why static data of type `turret-path-event` doesn't
decompile

The docs for all the hover-nav and nav-network code could use some love
in the future, I'm not smart enough to figure out what any of that code
actually means, but it seems to work...

Also threw in the fix for the ▲ that was accidentally left commented
out.
2023-02-09 18:22:56 -05:00
Tyler Wilding 0e3d93dd13
ci: allow manually updating the controller db (#2200)
Noticed this has been failing for a while for reasons. I think I fixed
them but can't re-run the current job (out of date from master). This
this gives me a way to manually re-run it.
2023-02-09 22:18:57 +00:00
Hat Kid 4ee402984f
decomp: citizen-* files, metalhead-* files, civilian, guard, hal3-course (#2194)
No more ghost town!

Manual patches:

- `hal3-course`: In `(anon-function 17 hal3-course)`, the decompiler is
doing something strange with `s3-0` that fails to compile, so I just
removed the `set!` and inlined the condition in the `when`.
- `guard`: Rewrote `(.mula.s)` stuff
2023-02-07 19:56:06 -05:00
Matt Dallmeyer fc5c75534d
Autosplitter - add per-level fly & orb counts (#2192)
Adds fields to the autosplit struct for the number of orbs and scout
flies collected in each level. This can be used for autosplitting on
orb/fly counts

Tested together with https://github.com/open-goal/speedrunning/pull/8


[autosplit_orbs.mp4](https://user-images.githubusercontent.com/2515356/216900730-92b7b947-cc4a-4629-b7f2-1dc10248c9e9.mp4)

[autosplit_fly.mp4](https://user-images.githubusercontent.com/2515356/216900759-e3042426-7cb0-4cb9-ae05-9c44827df6a0.mp4)


![image](https://user-images.githubusercontent.com/2515356/216901323-ffae97c8-3557-45f8-91db-cd86d76dd498.png)

![image](https://user-images.githubusercontent.com/2515356/216901026-59eb3fb6-281d-489d-a50c-010760246072.png)
2023-02-07 19:41:48 -05:00
water111 45f7770ca2
[decomp] finish up nav-graph, traffic-engine, traffic-manager, height-map (#2191)
Some of these were almost done, just needed a few more types.
2023-02-05 18:16:58 -05:00
Tyler Wilding a83bd49426
d/jak2: finish onin-game and resolve type-hinting (array object) elements (#2188)
Fixes https://github.com/open-goal/jak-project/issues/2047
2023-02-04 20:36:30 -05:00
ChillyPepper fd6d59cd88
Jak2 decomp/hover formation (#2028)
This is a WIP while I'm learning the ins and outs of decompilation, but
putting up what I have for 2 reasons:

- Hoping someone can double check I'm on the right path (all functions
have signatures, all reasonably safe guesses for types have been put in,
using "object" for type where they're not)
- Might be blocked by not being able to run the offline-tests as a PAL
scrub

I'm going to look at what might be involved in making tests work for
PAL, but wouldn't be surprised if I have to wait to get a black label
version and come back to this after :(

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-02-04 20:03:46 -05:00
Luminar Light 89feb5d0f1
Create Hungarian translation of game text for Jak 1 (#2141)
This will probably take a while, since we also have to translate all the
text of the base game - Naughty Dog never translated this game to
Hungarian. This PR will stay a draft until it is complete.

We realized that every letter in our alphabet was already working, apart
from two: Ő and Ű (they are unique sounds, so leaving their marks
wouldn't be okay).
Since I did not find that double accent thing in the jak font, I decided
to use ~ (see my change in FontUtils.cpp). It is good enough, and my
memory tells me that I already saw this exact same "solution"
(workaround) somewhere in the past. If anyone knows a better solution,
please let us know.

We chose ID 14 for the Hungarian language, as it was the lowest free ID.

**Progress tracker**
A tick here means that everything was translated. It does not mean that
everything is perfect yet. We will review everything multiple times, to
have the best translations possible.

Game text:
- [x] base game text
- [x] pc port text
- [ ] credits text ?

[Sziloyoo](https://github.com/Sziloyoo) helped with reviewing my
changes, and gave advice/suggestions for some complicated translations.

Subtitles will be done in the future, not in this PR.
2023-02-04 20:01:22 -05:00
Matt Dallmeyer 2c5e456571
Minor fix for Rock Village IL speedrun (#2187) 2023-02-02 21:51:28 -05:00
water111 65eef8ff26
[jak2] pc-hook for pris texture upload (#2184)
Fixes a bunch of hud textures:


![image](https://user-images.githubusercontent.com/48171810/215919174-b6ff9af7-0408-4e97-b142-0fbbeafa196a.png)
2023-01-31 20:36:07 -05:00
BreakPoints 1be8110557
More DGOs in Jak2 inputs.jsonc (#2182) 2023-01-31 18:43:38 -05:00
Tyler Wilding b72383964f
d/jak2: cleaning up the remainder of unblocked / unclaimed files (#2171)
Co-authored-by: water <awaterford111445@gmail.com>
2023-01-31 18:32:50 -05:00
water111 71cb1aef6f
[merc2] support vertex updates, use this for blerc in jak 1 and jak 2 (#2179)
This PR adds a feature to merc2 to update vertices. This will be needed
to efficient do effects like blerc/ripple/texture scroll. It's enabled
for blerc in jak 1 and jak 2, but with a few disclaimers:
- currently we still use the mips2c blerc implementation, which is slow
and has some "jittering" because of integer precision. When porting to
PC, there was an additional synchronization problem because blerc
overwrites the merc data as its being read by the renderers. I _think_
this wasn't an issue on PS2 because the blerc dma is higher priority
than the VIF1 DMA, but I'm not certain. Either way, I had to add a mutex
for this on PC to avoid very slight flickering/gaps. This isn't ideal
for performance, but still beats generic by a significant amount in
every place I tested. If you see merc taking 2ms to draw, it is likely
because it is stuck waiting on blerc to finish. This will go away once
blerc itself is ported to C++.
- in jak 1, we end up using generic in some cases where we could use
merc. In particular maia in village3 hut. This will be fixed later once
we can use merc in more places. I don't want to mess with the
merc/generic selection logic when we're hopefully going to get rid of it
soon.
- There is no support for ripple or texture scroll. These use generic on
jak 1, and remain broken on jak 2.
- Like with `emerc`, jak 1 has a toggle to go back to the old behavior
`*blerc-hack*`.
- In most cases, toggling this causes no visual differences. One
exception is Gol's teeth. I believe this is caused by texture coordinate
rounding issues, where generic has an additional float -> int -> float
compared to PC merc. It is very hard to notice so I'm not going to worry
about it.
2023-01-31 18:23:39 -05:00
Tyler Wilding 22bae7fbe0
g/jak2: Add missing DGO files to game.gp lost in the shuffle (#2178)
When I cleaned up the `game.gp` some DGOs were no longer referenced
because my first dependency script omitted them -- thinking they weren't
required. From the perspective of the source files they indeed weren't
required but we still have to produce the DGO file.

also works around #2177
2023-01-30 20:45:45 -05:00
Tyler Wilding ae219f257d
repl: support game-specific startup.gc files (#2176) 2023-01-30 20:45:03 -05:00