Commit graph

895 commits

Author SHA1 Message Date
Tyler Wilding bc40fc5d2f
util/file: cleanup log initialization and some file-util functions (#2299)
Fixes both issues mentioned in #2297
2023-03-01 17:52:33 -05:00
ZedB0T 43da4088e6
Fix Bombbot crash (#2296) 2023-02-28 20:39:57 +01:00
water111 2c12a4e00b
[jak2] WIP minimap (#2280)
Work in progress minimap. Known issues:
- "path finding" doesn't appear to work - it gets stuck forever in many
cases
- some nasty patches around timer-based code
- jak arrow blending issues
- would be nice to make it higher resolution

if the search is forced to terminate due to iteration/time limits, the
icon is not in the right place

![image](https://user-images.githubusercontent.com/48171810/221432792-678d6124-a6a6-4875-a91f-7eceedbfec98.png)
2023-02-27 19:51:14 -05:00
ManDude 1d0a5ade8d
[jak2] minor decomp cleanup + add force actors and sprite pc hacks (#2291)
I didn't actually visually notice much of a difference with these hacks
unlike in Jak 1, but I also avoided checking the missions thoroughly
since the game crashes very often right now.
2023-02-28 00:35:57 +00:00
Hat Kid adf929d18d
decomp: ruf-*, jinx-*, mog-*, grim-*, hosehead-* files, gun-buoy (#2279) 2023-02-27 18:53:57 -05:00
Matt Dallmeyer 9b80bca589
Add Speedrun Category Extensions (#2195) 2023-02-26 13:42:24 -05:00
Tyler Wilding 90d5e83d9e
d/jak2: finish forest-obs (#2266) 2023-02-26 09:49:16 -05:00
ManDude 190fa4bbe8
[windows] make the games start up in the user's preferred system UI language (#2267)
Where applicable, of course.

My system language is set to English so I actually can't test this. If
anyone has their Windows language (NOT LOCALE) set to Spanish, German,
French, Italian or Japanese please test this.

Fixes #1734 

Also fixes the opengoal debugger on Windows and fixes the decomp for
`menu` which was causing some crashes related to input handling.
2023-02-26 09:46:57 -05:00
water111 928dbebee4
[jak2] fix highly aggressive guard zoomer ambush (#2264)
`*alert-level-settings*` was actually an inline array and we were
indexing past the end of it.
I think this will fix some of the strange on-foot guard behavior too.
2023-02-26 01:31:21 -05:00
water111 3f1f443d58
[jak 2] fix boot, increase level heap sizes (#2252)
Increase level heaps and borrow heaps. The level heap increase was
likely not needed, but better safe than sorry. We allocate the 128 MB
main heap anyway so there's no harm.

Also fix the crash when using `-boot`. As I thought it was just a
one-line typo in the kernel.
2023-02-25 15:20:17 -05: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
Matt Dallmeyer e89f0770dc
Fix Jak 2 warp gates (#2244) 2023-02-24 19:33:27 +01: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
Hat Kid d946a09a99
decomp: palcab-obs (#2222)
Co-authored-by: water <awaterford111445@gmail.com>
2023-02-18 15:59:34 -05:00
Hat Kid f452a504e6
decomp: race-* files (#2224) 2023-02-18 15:45:00 -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
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 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 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
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
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
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
water111 fff3a2d872
[extractor] create debug_out (#2159)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-30 19:20:29 -05:00
Matt Dallmeyer 2645fed47a
Jak 1 Checkpoint Select / IL Speedrun support (#2162) 2023-01-30 19:11:57 -05:00
BreakPoints 23c1f3019b
Update Jak2 inputs.jsonc for first time compiles (#2172) 2023-01-29 13:17:34 -05:00
Tyler Wilding 18507bc78e
d/jak2: get portrun working and decompile a bunch of miscellaneous files (#2169) 2023-01-28 19:36:57 -05:00
Hat Kid be035181f0
decomp: squid-* files (#2170)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 18:44:10 -05:00
Tyler Wilding e6f55b9b55
d/jak2: decompile all *-texture files except castle-texture (#2149)
Fixes https://github.com/open-goal/jak-project/issues/2051
2023-01-28 17:37:37 -05:00
Hat Kid 8b21a55906
decomp: blerc, ripple, under-* files (#2163)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 16:02:58 -05:00
Hat Kid e0ee9b6a81
decomp: drill-obs, drill-obs2, drillmid-obs, drill-panel, drill-spool (#2152)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-01-28 15:41:48 -05:00
Hat Kid fa8c789dcd
decomp: eye (#2148) 2023-01-28 15:17:49 -05:00
water111 0fcc7eb8e9
[merc2] Support emerc (#2147)
This adds environment mapping support to `Merc2`, and turns it on for
Jak 1 and Jak 2.

- The performance is much better
- Jak 1 can be toggled back to the old behavior with `(set! *emerc-hack*
#f)`. The new environment mapping is identical to the old one everywhere
I checked.
- Jak 1 still falls back to generic for ripple/texscroll/blerc/eyes -
there's still no dynamic texture or vertex updating support. The eye
detection stuff will sometimes flag stuff as eyes which is not eyes,
which is fine, but means that generic will be used in some places where
emerc could be used. For example, the shiny plates on jak's arm will be
drawn with generic because jak has eyes.
- Jak 2 hasn't been checked super carefully against PCSX2 yet.
- Jak 2 still isn't technically using emerc, but instead putting emerc
models in the merc bucket.
- The interface to merc is a lot different now and totally custom
OpenGOAL DMA code. The original merc drawing asm doesn't run anymore.
- The FR3 format changed
- Something funky going on with foreground lighting in escape, but
doesn't seem to be related to this change?

Performance comparison, jak 1, in likely the most generic-merc heavy
spot:

![image](https://user-images.githubusercontent.com/48171810/213882718-feb2ab59-95a9-44a2-b0e5-95fba860c7b0.png)

![image](https://user-images.githubusercontent.com/48171810/213882736-8dbbf4c9-6bbf-4d0b-96ce-78d63274660c.png)
2023-01-22 18:30:31 -05:00
Tyler Wilding 50c57e23be
d/jak2: "finish" traffic-manager, vehicle-util and citizen-h (#2144)
Some more progress on vehicle code, the following files still remain:
- vehicle-guard (annoying stack types)
- traffic-engine (many issues, some which already have issues made for
them, other entirely new confusing things!)
2023-01-22 18:16:24 -05:00
Hat Kid 3d08d079c9
jak2: ocean renderer (#2142)
Initial implementation of the `ocean-mid`, `ocean-far` and `ocean-near`
renderers for Jak 2.

There's still a few things to sort out, mainly:

- [x] ~Backwards compatibility with Jak 1. The only thing that currently
stands in the way of that is figuring out a clean way to "un-hardcode"
the texture base pointer in C++ without creating a completely separate
`OceanTexture` class for Jak 2. One thing I thought of would be
modifying `BucketRenderer`'s virtual `init_textures` method to also pass
the `GameVersion`, but I'm not sure if there's a better way.~
- [x] ~The sudden transition from `ocean-near` to `ocean-mid`. Not sure
why it's happening or how to fix it.~
- [x] The ocean has two new methods in Jak 2, `ocean::89` and
`ocean::79`, one of which seems to be related to time of day sky colors.
~Even without them implemented, the end result looks quite close, so we
may be able to skip them?~ `ocean::89` generates `ocean-mid` envmap
textures, so it will likely be required, but will not be handled right
now.

Reverted the VU prologue removals because it made the tests fail.
2023-01-22 18:07:46 -05:00
Tyler Wilding 2ba07eb058
d/jak2: finish consite-obs and get almost all side-missions working (#2143)
Some side missions require cars, they don't work yet. Also the
ring-races and collection ones do not grant orbs. The hoaming beacon
collection one causes a `hud` crash
2023-01-22 09:31:39 -05:00
Tyler Wilding 98393c6f4c
goalc: support static arrays of types (#2140)
draft because using the array is a little weird still, don't feel like
dealing with window's slow debugging builds today.

I get the following weird error:
```clj
(define test-array (new 'static 'boxed-array :type type vector))
gr> (-> test-array 0)
1538004        #x1777d4              0.0000        vector
gr> (type? (-> test-array 0) type)
1342757        #x147d25              0.0000        #t
gr> (new 'static (-> test-array 0))
-- Compilation Error! --
Got 3 arguments, but expected 2
Form:
(-> test-array 0)
Location:
Program string:1
(new 'static (-> test-array 0))
^
Code:
(new 'static (-> test-array 0))
```

Maybe this is expected though and the `new` method wants a symbol, not a
type?

Fixes #2060

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 21:40:39 -05:00