Adds support for adding custom subtitles to Jak 2 audio. Comes with a
new editor for the new system and format. Compared to the Jak 1 system,
this is much simpler to make an editor for.
Comes with a few subtitles already made as an example.
Cutscenes are not officially supported but you can technically subtitle
those with editor, so please don't right now.
This new system supports multiple subtitles playing at once (even from a
single source!) and will smartly push the subtitles up if there's a
message already playing:
![image](https://github.com/open-goal/jak-project/assets/7569514/033e6374-a05a-4c31-b029-51868153a932)
![image](https://github.com/open-goal/jak-project/assets/7569514/5298aa6d-a183-446e-bdb6-61c4682df917)
Unlike in Jak 1, it will not hide the bottom HUD when subtitles are
active:
![image](https://github.com/open-goal/jak-project/assets/7569514/d466bfc0-55d0-4689-a6e1-b7784b9fff59)
Sadly this leaves us with not much space for the subtitle region (and
the subtitles are shrunk when the minimap is enabled) but when you have
guards and citizens talking all the time, hiding the HUD every time
anyone spoke would get really frustrating.
The subtitle speaker is also color-coded now, because I thought that
would be fun to do.
TODO:
- [x] proper cutscene support.
- [x] merge mode for cutscenes so we don't have to rewrite the script?
---------
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
Updates the decompiler for the new format and there's new macros. This
new format should be easier to read/parse.
Also rewrote `sp-init-fields!` (both jak 1 and 2) from assembly to GOAL.
Hopefully I did not miss any regressions in Jak 1/2 while updating the
files, it's a lot.
My mistake -- testing focused too much on preserving the existing
behaviour I clearly forgot to make sure the new stuff worked properly.
Just had to early out and not modify the args if they were in the new
format.
An attempt to cleanup the last CLI interface we have left to cleanup.
- `gk` args now follow the typical convention ie. `--proj-path` instead
of `-proj-path`.
- args that are passed through to the rest of the application / the
game's runtime use the typical convention of following a `--`
- I'm thinking some args shouldn't be handled at this level ie
(`-nodisplay`, `-vm`, `-novm` or `-jak2`) These could be better
documented as legitimate flags and passed in via a nice struct. They
don't seem to be used in `InitParams` but I'll triple check.
There's a temporary shim here so there is no coupled release with the
launcher (right now it executes `gk` with a few args). So I just change
the old args into the new format. After one release cycle, I can change
it in the launcher and delete it here.
I am unsure if this will break the bash shellscript usages -- not sure
which args were usually passed into `$@`
![image](https://user-images.githubusercontent.com/13153231/222035309-b6601719-cdc9-40ee-b36e-e4b135d3f128.png)
Reasons for doing so include:
1. This should stop the confusion around editing the wrong config file's
flags -- when for example, extracting a level. Common settings can be in
one central place, with bespoke overrides being provided for each
version
2. Less verbose way of supporting multiple game versions. You don't have
to duplicate the entire `type_casts` file for example, just add or
override the json objects required.
3. Makes the folder structure consistent, Jak 1's `all-types` is now in
a `jak1` folder, etc.
Adding support for better child-type method docstrings. This is a
problem unique to methods.
Usually, a child-type will have the same signature and a common name
will apply, but the implementation is different. This means, you
probably want a different docstring to describe what is happening.
Currently this is possible to do via `:replace`. The problem with
replace is two fold:
- a replaced method ends up in the generated `deftype`...because you
usually change the signature!
- we don't put docstrings in the `deftype` in normal GOAL, this is just
something we do for the `all-types` file (they go in the `defmethod`
instead)
- more importantly, this means anytime you now want to change the
parent's name/args/return type -- you have to apply that change
everywhere.
So this is a better design you can now just declare the method like so:
```clj
(:override-doc "my new docstring" <method_id>)
```
And internally a pseudo-replaced method will be added, but it will
inherit everything from the parent (except the docstring of course)
Unrelated - I also made all the keyword args for declaring methods not
depend on ordering
This also adds support for documenting virtual and non-virtual state
handlers. For example:
```clj
(:states
(part-tester-idle (:event "test") symbol))
```
or
```clj
(idle () _type_ :state (:event "test") 20)
```
I will probably add the ability to give some sort of over-view docstring
at a later date.
Co-authored-by: water <awaterford111445@gmail.com>
- 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.
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>
- 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>
Two main problems fixed here:
- offline tests will fail on a comparison failure (a mistake from the
re-write)
- art-group-info is committed to the repo and shared with every thread
(running the tests with 1 thread, for example on the CI, and locally
were producing different results)
art files are still not provided to the jak2 offline tests:
- `*-ag` files are not being output
- `art-elts.gc` is not complete, as a handful of files claim to be
missing stuff
lastly, in jak1's offline tests we were also running `tpage` and `*-vis`
files through the decompiler. This omits that (they came from the
`all_objs.json` file) -- is this an issue?
Couldn't finish any of the enemy/nav-enemy related files for one reason
or another, but quite a bit of work that will be easier to merge and
iterate on instead of keeping track of the branch.
enemy/idle-control has some very weird focus related code.
nav-mesh/nav-control still has a bunch of CFG resolution problems that
need to be manually resolved.
Co-authored-by: water <awaterford111445@gmail.com>
The offline-tests are going to end up taking too long for jak 2, I did
some rough math and by the end of it we'll be spending almost 2 minutes
for a full offline test on my machine.
These changes allow us to throw hardware at the problem
Still some work to do to make the output nicer, but seems to be fairly
reliable. By default it still uses 1 thread, use `num_threads` to change
this.
This PR does a few main things:
- finish decompiling the progress related code
- implemented changes necessary to load the text files end-to-end
- japanese/korean character encodings were not added
- finish more camera code, which is required to spawn the progress menu
/ init the default language settings needed for text
- initialized the camera as well
Still havn't opened the menu as there are a lot of checks around
`*target*` which I havn't yet gone through and attempted to comment out.
And everything else needed for them!
A couple functions are bad currently.
- fixes#1929 - untested on linux
- fixes#1924 - now you need to type `,` before a lambda you want to put
in a pair.
- fix debugger symbol table in jak 2
- made the decompiler output `(meters 2)` instead of `(meters 2.0)`
- fixed a bug with the bitfield enum special -1 case
- made bad game text decomp not exit the decompiler
- added `editable-player` and `script`
* decomp: add `docstring` support to relevant places in `all-types`
* decomp: output method docstring into the `defmethod` instead
* goalc: handle docstrings in `define[-extern]` (gracefully ignore for now)
* decomp: output docstrings for bitfield deftypes too
* goalc: fix `defenum` parsing when coming from the compiler (no symbol metadata to store to)
* lsp/tests: fix ups
* lint: formatting
* goalc: handle edge-case of defining a string constant
* cleanup leftovers, fix codacy issues, rename struct
* lsp: json-rpc example is working, a decent place to start...
* lsp: vendor library
* lsp: cleanup and time to get started
* lsp: commit what i got so far
* lsp: example `initialize` payload
* lsp: switch to `stdio`
* stash
* modularize the lsp implementation
* lsp: implement first actual LSP feature - function names in outline
* lsp: produce document diagnostics
* lsp: remove unused third-party lib
* lsp: support hovering MIPS instructions in IR files
* lsp: basic go-to all-types definition
* stash
* lsp: cleanup code, just need to add it to the release artifacts
* fix some project configuration
* fix linux build
* lsp: add lsp to PR artifacts and release assets
* lsp: address feedback
* fix utf-8 handling around env-vars
* fix file opening errors related to unicode
* add uncaught exception handler in `gk` to ensure something is logged
* gracefully fail if window icon cant be loaded and work with unicode
* linux fix and add changes to vendor file
* git: ignore vs build dir
* cmake: ditch `clang-cl` on windows in favor of actual `clang`
* build: suppress a significant number of warnings
* build: adjust workflows and vendor nasm
* docs: update docs to remove `clang-cl` mentions
* tests: move jak1 reference tests into their own folder
* tests: update offline tests to support multiple games
* tests: some additional fixes and multi-game handling
* tests: update reference tests
* extractor: refactor and cleanup for multi-game support
* deps: switch to `ghc::filesystem` as it is utf-8 everywhere by default
* extractor: finally working with unicode
* unicode: fix unicode cli args on windows in all `main` functions
* put some duplicated code in a func
* make jak 2 text "work"
* group up all subtitles c++ code into one folder
* compact single-line subtitles
* fix a couple compiler crashes
* Update game_subtitle_en.gd
* `rolling` and `sunken`
* `swamp`
* `ogre`
* `village3`
* `maincave`
* `snow`
* `lavatube`
* `citadel`
* Update .gitignore
* clang
* fix encoding and decoding for quote
* properly fix quotes
* subtitle deserialize: sort by kind, ID and name
* sub editor: fix line speaker not being converted
* cleanup game text ids 1
* update text ids 2
* update source
* update refs
* PAL dumps files
* alrighty then
* make PAL warning slightly more specific
* PAL patches for `title-obs`
* Update all-types.gc
* PAL patch `beach-obs`
* `process-taskable` PAL patch
* `ambient` PAL patch
* `yakow` PAL patch
* `village-obs` PAL patch
* `sparticle-launcher` patch
* `swamp-obs` PAL patch
* `sequence-a-village1` PAL patch
* typo
* errors
* `powerups` PAL patch
* `ogreboss` PAL patch
* jak 1 v2 encoding
* `load-boundary` PAL patch
* `flying-lurker` PAL patch
* `mayor` PAL patch
* update game encoding to PAL (v2) encoding
* `cam-debug` and `cam-update` PAL patch
* `fisher` PAL patch
* `target` PAL patch
* `target2` PAL patch and fix text compiling
* `target-death` PAL patch
* `target-racer-h` PAL patch
* `logic-target` PAL patch
* `main` PAL patch
* `snow-flutflut-obs` PAL patch
* `rolling-obs` PAL patch
* `gsound` PAL patch
* update refs
* `progress` and `progress-draw` PAL patches
* clang
* wrong.
* complain
* clang
* fix test
* fix blurry jp text
* fix weird interrupt lag from setting window size
* patch more text lines, special handling for credits
* Update FontUtils.cpp
* Add xdelta3 and file patching interface
* add window lock toggle and update settings ver
* better particle hacks
* add PAL support to extractor
* Fix credits
* also NTSC-J support
* make xdelta3 a separate library
* address feedback
Co-authored-by: water <awaterford111445@gmail.com>
* stash
* temp
* tools: subtitle tool works! just gotta fill out the db / polish UX
* tools: added configuration for every subtitle we have so far
* tools: add some colors to the editor, time for repl controls and make it run the code!
* tools: continuing polish of tool, getting very close
* tools: finished UX polish, just need to write deserializers
* tools: added deserializer for subtitle data
* tools: exported subtitle files, all data appears intact
* tools: more UX polish and test all the cutscenes, majority work
* assets: update subtitle files
* lint: formatting and cleanup
* lint: codacy lints
* goalc: cleanup goalc's main method and add nrepl listener socket
* deps: add standalone ASIO for sockets
* lint: formatting
* common: make a common interface for creating a server socket
* goalc: setup new repl server
* deps: remove asio
* goalc: debug issues, nrepl is working again
* git: rename files
* attempt to fix linux function call
* test
* scripts: make the error message even more obvious....
* goalc: make suggested changes, still can't reconnect properly
* game: pull out single-client logic from XSocketServer
* nrepl: supports multiple clients and disconnection/reconnects
* goalc: some minor fixes for tests
* goalc: save repl history when the compiler reloads
* common: add include for linux networking
* a few small changes to fix tests
* is it the assert?
* change thread start order and add a print to an assert
Co-authored-by: water <awaterford111445@gmail.com>
* deps: add `xxhash` library
* extractor: hash ISO files as they are extracted
* extractor: report on game data validation errors
* lint: formatting
* extractor: automatically pick the right decompiler config
* cmake: reduce warning spam especially from libs
* runtime: add FS helper functions
* game: save/restore pc-settings | add original aspect option
* game: overwrite unloadable settings with defaults
* temp: unable to set the games aspect-ratio in the boot else crash?
* runtime: save memcard files to user directory as well
* runtime: fix `pckernel` load order which resolves setting the orig aspect ratio
* lint: format
* cmake: revert warning suppression, it's just causing problems it seems
* fix the order of the rest of `pckernel` and creation of obj file paths
* lint: formatting
* game: don't save settings on startup even if they are corrupted
* ci: switch to codacy for coverage
* docs: update badges
* decomp: allow overriding config flags via CLI
* cleanup: top level file cleanup
* docs: big README overhaul
Attempt to close#1128 and #1086
* decomp: attempt to detect if `iso_data` is missing or wrongly extracted
* game: switch to `fpng` for screenshots, allow for compression
closes#1035
* game: switch vsync control to a checkbox
* lint: format cpp files
* lint: format json files
* docs/scripts: organize taskfile
* delete unused shaders
* hide some options in debug menu
* change fullscreen logic a bit
* add "all actors" toggle
* borderless fix and fix alpha in direct renderer untextured (do we need a separate shader for that?)
* fix fuel cell orbit icons in widescreen
* fix `curve` types
* refs
* fix levitator task...
* fix some task stuff
* update font code a bit (temp)
* cmake, third-party and visual studio overhaul
* Update .gitmodules
* update modules
* clone repos
* fix encoding in zydis
* where did these come from
* try again
* add submodule
* Update 11zip
* Update 11zip
* Update 11zip
* delete
* try again
* clang
* update compiler flags
* delete 11zip. go away.
* Create memory-dump-p2s.py
* properly
* fix minimum architecture c++ compiler flags
* fix zydis
* oops
* Update all-types.gc
* fix clang-cl tests
* make "all actors" work better, entity debug qol
* update game-text conversion code to be more modularized
* Create vendor.txt
* fix typos and minor things
* update refs
* clang
* Attempt to add clang-cl support to vs2019 and CI
* vs2022 + clang-cl
* srsly? fix clang build
* Update launch.vs.json
* extend windows CI timer
* cmake: disable edit&continue flags
* goos: make the build system work for alternate file paths nicely
* vs: update vs config
* vscode: extend terminal buffer!
* vs: fix presets
* debugger: fix exception handler
* game: add logo to application
* decomp: get `cam-master` to "work" -- manually changed return type
* debugger: fix printing issue
* game: get the camera actually working
* game: neutralize the analog sticks
* game: support analog sticks
* tests: update ref tests
* temp commit - inprogress stuff
* fix `send-macro`
* turn camera stuff back on, seems to work. Still kernel-dispatch problem though
* address feedback
* formatting