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>
Also fixed an original game bug in `loader.gc` on a method that's called
quite often, though I have no clue what erroneous behavior it could have
even caused.
This fixes a long time issue with `lambda`. The `lambda` is a bit
overloaded in OpenGOAL: it's used in the implementation of `let`, and
also to define local anonymous functions.
```
(defmacro let (bindings &rest body)
`((lambda :inline #t ,(apply first bindings) ,@body)
,@(apply second bindings)))
```
```
(defmacro defun (name bindings &rest body)
(let ((docstring ""))
(when (and (> (length body) 1) (string? (first body)))
(set! docstring (first body))
(set! body (cdr body)))
`(define ,name ,docstring (lambda :name ,name ,bindings ,@body))))
```
In the first case of a `let`, a `return` from inside the `let` should
return from the functioning containing the `let`, not the scope of the
`lambda`. In the second case, we should return from the lambda. The way
we told the different between these cases was if the `lambda` was used
"immeidately", in the head of an expression (like it would be for the
`let` macro). But, this falsely triggers when an anonymous function is
used immediately: eg
```
((lambda () (return #f)))
```
should generate and call a real x86 function that returns immediately.
This should fix some death/mission failed stuff in jak 2.
This fixes the issue where elevators leave you behind (stack structure
related)
At the same time I cleaned up some things I found along the way, most
notably changing `script-context`'s `basic` field to `object` as
non-basics use this method as well.
Fixes#2305
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.
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>
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
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`
* dont crash on inline static value array
* [goalc] add support for non-static inline arrays of values
* add a kernel group to jak1
* move and cleanup pc debug code
* random cleanup in `hud-classes`
* pc port fix for gondola spools
* format
* address feedback (wow it was actually just changing 1 line all along...)
* minor decomp cleanup
* ref test
* only show subtitle notices during a subtitle context
* move language & subtitles (back) to game options
* remove "accessibility" menu and put its option in "misc"
* new subtitle language selection
* properly split audio & text language
* Update game_text_en.gs
* misc setting size fixes
* better fix for subtitle notice
* final touches
* subtitle fixes & uk-english subtitles
* more english fixes
* remove str files from inputs
* removed unused verbose flag
* allow some kind of conditional game building for JP extras
* make `PrintBankInfo` do nothing
* clang
* Update gltf_mesh_extract.cpp
* fix `*jak1-full-game*` in extractor
* use json library to build json file
* screw it red label support as well
* 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
* some jp support to fix some errors in the original game
* music fade toggle
* recognize `process-new` macros!!
* strip casts in this macro
* rename macro
* fix cast typecheck
* update source 1
* detect kernel stack case
* less boilerplate
* `manipy-spawn` special case
* pretty printer improvements
* revert dumb thing from earlier
* use shell detection on `send-event`
* fix some events
* remove unused argument
* detect `static-attack-info` and add `CondNoElse` to shell detect
* better `attack-info` detect
* support `process-spawn` in multi-lets
* detect `rand-float-gen` pt 1
* detect as return value
* detect in `countdown` and `dotimes`
* oops this wasnt working
* fancier `send-event`s
* clang
* update source!!
* fix tests
* fine jeez
* uh okay
* fix some accidental regressions
* fix more regressions
* regression fixes
* fix big bug...
* extra safety!
* music flava hack toggle
* fix hint subtitles not being considered offscreen
* music player works
* fixes + citadel, maincave, lavatube music
* add remaining tracks
* fix test
* fixes
* fix lib
* update refs
* [decompiler] read and process art groups
* finish decompiler art group selection & detect in `ja-group?`
* make art stuff work on offline tests!
* [decompiler] detect `ja-group!` (primitive)
* corrections.
* more
* use new feature on skel groups!
* find `loop!` as well
* fully fledged `ja` macro & decomp + `loop` detect
* fancy fixed point printing!
* update source
* `:num! max` (i knew i should've done this)
* Update jak1_ntsc_black_label.jsonc
* hi imports
* make compiling the game work
* fix `defskelgroup`
* clang
* update refs
* fix chan
* fix seek and finalboss
* fix tests
* delete unused function
* track let rewrite stats
* reorder `rewrite_let`
* Update .gitattributes
* fix bug with `:num! max`
* Update robotboss-part.gc
* Update goal-lib.gc
* document `ja`
* get rid of pc fixes thing
* use std::abs
* detect `seek!` and `seekl!`
* fancy struct instead of pair mess
* fixes
* i think this was wrong?
* update refs
* update source
* More logical branching
* even better branching
* Only append compiler flags in cmake
* add `RelWithDebInfo-clang` windows build
* bump serializer initial buffer size to 32mb
* extra flags for msvc
* proper anaphoric goal macros
* specify windows sdk version?
* fix "Object files are not named properly" fake error
* Update goal-lib.gc
* fix typo
* more typo
* shorten discord rpc text
* allow expanding enums after the fact (untested)
* make `game_text` work similar to subtitles
* update progress decomp
* update some types + `do-not-decompile` in bitfield
* fixes and fall back to original progress code
* update `progress` decomp with new enums
* update config files
* fix enums and debug menu
* always allocate (but not use) a lot of particles
* small rework to display mode options
* revert resolution/aspect-ratio symbol mess
* begin the override stuff
* make `progress-draw` more readable
* more fixes
* codacy good boy points
* first step overriding code
* finish progress overrides, game options menu fully functional!
* minor fixes
* Update game.gp
* Update sparticle-launcher.gc
* clang
* change camera controls text
* oops
* some cleanup
* derp
* nice job
* implement menu scrolling lol
* make scrollable menus less cramped, fix arrows
* make some carousell things i guess
* add msaa carousell to test
* oops
* Update progress-pc.gc
* make `pc-get-screen-size` (untested)
* resolution menu
* input fixes
* return when selecting resolution
* scroll fixes
* Update progress-pc.gc
* add "fit to screen" button
* bug
* complete resolutions menu
* aspect ratio menu
* subtitles language
* subtitle speaker
* final adjustments
* ref test
* fix tests
* fix ref!
* reduce redundancy a bit
* fix mem leaks?
* save settings on progress exit
* fix init reorder
* remove unused code
* rename goal project-like files to the project extension
* sha display toggle
* aspect ratio settings fixes
* dont store text db's in compiler
* properly save+load native aspect stuff
* [goalc] macro expansion in integer constants
* working
* didn't break it yet
* support conditional compilation
* fix up some more small bugs
* fix duplicate evaluation of bitfield definitions
* paranoid
* decompiler: support adding new strings to the game_text.txt file
* gsrc: expand the pckernel type and functions to work better with the menu
* gsrc: add new text-ids
* gsrc: add new macros to help with menu code
* gsrc: make a new type to generalize their list menu options
* gsrc: add new menu options and enums
* gsrc: cleanup and refactor the list menu option drawing code
this allows us to easily add a new list menu option...well as easy as the rest is atleast (setting up static lists properly, etc)
* gsrc: add and cleanup handling of new menu options
* scripts: add checks with nice error messages for user facing taskfile recipes
* lint: formatting
* address simple feedback
* gsrc: move modified files to `pc/` folder
* gsrc: revert changes to originally decompiled files
* gsrc: move modified and new files to `goal_src/pc` folder
* gsrc: update paths in `all_files.gc`
* add subtitles support (tools + goal + text file).
* add to build system proper
* better handling of line speakers
* billy test subtitles
* adjust timings
* better handling of subtitle timing + citadel subs
* press square to toggle cutscene subtitles
* improve DirectRenderer performance
* clang
* dont error out if there's no user files
* make system supports multiple inputs for subtitles
* clang
* oh no typo!!
* avoid future issues
* fix warp gate crash
* remove no longer necessary code in DirectRenderer
* remove temp prints
* delete triplicate code
* i found a better way
* fix make issues with subtitles
* force avx compilation
* some changes to make the `anim-tester` kinda work
* types for `lava` (who cares)
* fix divide by zero macros
* cleanup filenames
* fix tests + minor bug
* 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
* a crapton of fixes
* Update cavecrystal-light.gc
* damn you
* fix bunnies
* change codegen for int -> float cast (just add sign extension now)
* fix test
* this file is tagged anyway
* fix some stack types
* remove bad camera debug funcs
* add more heap bars and entity pick menu
* finish entity menu and make `music-flava` enum
* fix some `process-taskable` fields
* citadel sage crash fix
* fix citadel drop plats
* fix tests
* fix some casts
* update refs
* finish `village3-obs` and `snow-ball`
* Update README.md
* fix sidekick too
* fix issue?
* more entity inspect hardcoded checks
* more
* use `*display-actor-anim*` for something!
* CRAP
* also clear actor anim when deselecting entity
* *display-actor-anim* already renders this!
* do not display `path` tag info
* entity debug inspect tool
* one more
* make debug string even larger
* missing res tag types
* more polish and more known tags
* last few
* decomp: Add texture-upload to ref tests
* maybe 50% done?
* 5 functions to go!
* decomp: stuck in `navigate`
* work-around fp issue
* some cleanup and label casts
* working on supporting asm instructions -- this is currently WRONG
* support ASM operations
* fixes for asm op support
* decomp: finish the vast majority of `navigate`
* format
* update test though i think this suggests a regression!
* decomp: cleanup some more of navigate
* decomp: finish `rolling-lightning-mole`
* revert `r0` handling for `pcpyud` and `pextuw`
* update ref tests
* lint
* fix a failing test
* help
* navigate mostly works now, with some potential bugs
* remove my debugging logs
* update ref tests
* review feedback cleanup
* these are all likely fine
* can't get the crab to chase me anymore
* the crab is back
* fill collide cache with bounding box working
* yprobe fully working for background at least
* target
* final cleanup, add a bit more foreground mesh stuff that is untested
* warnings, merge issues
* tests
* revert debug changes, format'
* rendering perf
* update jak 2 config and hack to make game text dumpable
* update stuff
* update src
* do `cspace<-parented-transformq-joint!`
* progress.... kind of...
* more drawable stuff
* clagng
* bones begin
* more bones
* even more bones
* everything builds
* touches
* errors
* ?
* fix `quicksandlurker`
* updates
* update refs
* more fixes
* update refs
* fix a couple macros in ref tests
* `default-menu` cleanup
* add `find-instance-by-name` func
* improve debugger slightly hopefully
* fix IOP PLAY buffer overrun bug
* fix `default-menu` more
* automatically convert ints in static pairs to/from bintegers
* fix test
* clang
* fix a few more lambdas
* update refs
* add custom menu cuz cool
* oopsie! also make `default-level` and `halfpipe` go away
* add camera teleport menu
* update types in debug menu