Commit graph

241 commits

Author SHA1 Message Date
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
water111 d65a1c365a
some bug fixes (#2125) 2023-01-14 11:04:15 -05:00
water111 bd209bf460
More vmodes (#2120) 2023-01-11 20:44:45 -05:00
animalstyletaco fd5191bb9a
Fixed bug where mouse position offset(s) would always return a 0 (#2109)
Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2023-01-11 19:21:07 -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
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 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
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
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 73d38bd9ff
game/debugger: handle uncaught loader thread exceptions and better handle that situation on the windows debugger (#2075) 2023-01-01 12:31:12 -05:00
Tyler Wilding 9c631e11fe
offline-test: Partition by DGO and colorize/condense output (#2045)
This solves two main problems:
- the looming threat of running out of memory since every thread would
consume duplicate (and probably not needed) resources
- though I will point out, jak 2's offline tests seem to hardly use any
memory even with 400+ files, duplicated across many threads. Where as
jak 1 does indeed use tons more memory. So I think there is something
going on besides just the source files
- condense the output so it's much easier to see what is happening / how
close the test is to completing.
- one annoying thing about the multiple thread change was errors were
typically buried far in the middle of the output, this fixes that
- refactors the offline test code in general to be a lot more modular

The pretty printing is not enabled by default, run with `-p` or
`--pretty-print` if you want to use it


https://user-images.githubusercontent.com/13153231/205513212-a65c20d4-ce36-44f6-826a-cd475505dbf9.mp4
2022-12-22 13:41:33 -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
water111 70e231fa72
[jak 2] merc (#2039) 2022-11-30 22:36:09 -05:00
water111 7a1a64acba
target code bugfixes (#2034) 2022-11-21 20:25:20 -05:00
water111 e0ebc5a68e
[decomp] target-handler (#2027) 2022-11-20 09:21:25 -05:00
Tyler Wilding bf83f2442d
d/jak2: cleanup more of editable and editable-player (#2029)
- Rough start of the SQLite integration to facilitate the SQL queries
- Cleanup and disable a little bit of code so the game no longer crashes
when entering the editor
- Implement some of the mouse data stuff


![image](https://user-images.githubusercontent.com/13153231/202881481-95bc0a2a-ac3d-4f65-aff1-b9f7ee5ee345.png)


https://user-images.githubusercontent.com/13153231/202881484-399747e7-dcdb-4e09-93e9-b561a45c8a18.mp4

This is a very old branch so best to get it merged now that it's at a
decent point so it can be iterated on.
2022-11-19 23:28:20 -05:00
Tyler Wilding 84497712ff
d/jak2: finish task-arrow | carry-h | projectile | gun-[red|yellow|blue]-shot (#1864) 2022-10-29 15:22:57 -04:00
water111 e443676889
[decomp] sky-tng (#1972)
https://www.youtube.com/watch?v=fkAMvEYXOGc
2022-10-15 18:21:17 -04:00
Tyler Wilding fd7d9c3df5
d/jak2: finish scene (#1971)
`scene-player-init` has some weird `rtype-of` usage (mostly in the
`pair` clause)
2022-10-15 17:43:02 -04:00
water111 9a04c7e311
[decomp] sparticle, sparticle-launcher, set up sprite (#1949)
- fix crash with unhandled sparticle definition (happens with the weird
array int32s that I don't understand yet)
- update mips2c stuff
- add part-tester
- fix some issues around texture uploads
 

![image](https://user-images.githubusercontent.com/48171810/194784675-54e3dc58-7846-450d-a1e9-cefd841dda94.png)
2022-10-09 19:56:07 -04:00
water111 3d4dfb2077
[decomp] Decompile some time-of-day stuff, support new style Jak 2 time of day (#1943)
- Add "tfrag-water" tfrag tree support (may just be the same as Jak 1's
'dirt' for the settings)
- Add "tfrag-trans" tfrag tree support, reusing "trans-tfrag" from jak
1.
- Add a hack to `LinkedObjectFileCreation` to handle `oracle`, which is
accidentally multiply defined as a type leftover from jak 1 (an entity
in village1), and level info for jak 2.
- Add `VI1.DGO`
- add `time-of-day.gc`, and a few other stub functions so it works
- Set up some time of day stuff in GOAL for jak 2/PC renderers
- Clean up time of day in c++ renderers, support the more complicated
weight system used by jak 2 (backward compatible with jak 1, thankfully)

The mood functions now run, so this could cause problems if they rely on
stuff we don't have yet. But it seems fine for ctysluma and prison for
now.


![image](https://user-images.githubusercontent.com/48171810/194719441-d185f59c-19dc-4cd3-a5c4-00b0cfe1d6c3.png)


![image](https://user-images.githubusercontent.com/48171810/194719449-6e051bf3-0750-42e5-a654-901313dbe479.png)


![image](https://user-images.githubusercontent.com/48171810/194719455-3ca6793e-873a-449a-8e85-9c20ffeb4da3.png)


![image](https://user-images.githubusercontent.com/48171810/194719461-8f27af17-4434-4492-96cd-8c5eec6eafdf.png)


![image](https://user-images.githubusercontent.com/48171810/194719468-720715b9-985a-4acf-928c-eab948cfcb03.png)


![image](https://user-images.githubusercontent.com/48171810/194719486-bfb91e83-f6ca-4585-80ad-3b2c0cbbd5af.png)


![image](https://user-images.githubusercontent.com/48171810/194719492-df065d2f-cb5a-47e3-a248-f5317c42082f.png)


![image](https://user-images.githubusercontent.com/48171810/194719507-91e1f477-ecfe-4d6c-b744-5f24646255ca.png)
2022-10-08 13:33:03 -04:00
water111 f1682867af
[graphics] hook up visibility data for jak 2 (#1938)
It works!

Visibility off:

![image](https://user-images.githubusercontent.com/48171810/193422627-c5560519-6d20-4645-baa5-5236c7969d6e.png)

On:

![image](https://user-images.githubusercontent.com/48171810/193422631-716fff10-9ad7-486f-ad35-9ddcddf2c4eb.png)

Overall the visibility data looks a lot better than in jak 1.
2022-10-01 17:12:12 -04:00
water111 d52739226c
[decomp] decompile decomp.gc (#1936)
A few issues:
- lwidea's fr3 is getting loaded and unloaded all the time
- the debug line drawing clipping is wrong (doesn't seem wrong in pcsx2,
so I think this is on us)
- nothing actually using vis data yet
- at a large distance, our view frustum culling seems slightly too
aggressive (might be that viewport scissoring is wrong)
- in the city, things seem darker as you move away. unclear how this is
happening (fog?)
2022-10-01 13:39:56 -04:00
Tyler Wilding 4d751af38e
logs: replace every fmt::print with a lg call instead (#1368)
Favors the `lg` namespace over `fmt` directly, as this will output the
logs to a file / has log levels.

I also made assertion errors go to a file, this unfortunately means
importing `lg` and hence `fmt` which was attempted to be avoided before.
But I'm not sure how else to do this aspect without re-inventing the
file logging.

We have a lot of commented out prints as well that we should probably
cleanup at some point / switch them to trace level and default to `info`
level.

I noticed the pattern of disabling debug logs behind some boolean,
something to consider cleaning up in the future -- if our logs were more
structured (knowing where they are coming from) then a lot this
boilerplate could be eliminated.

Closes #1358
2022-10-01 11:58:36 -04:00
water111 b5705bde96
[decomp] Partial implementation of tie (#1916)
Some stuff isn't working fully yet:
- fog color
- time of day
- draw order for multiple passes (currently all draws in the default tie
bucket)
- possibly settings for transparent stuff (untested, but might work)
- the "vanish" effect (we might not want this anyway?)
- environment mapping/etie completely not implemented.


![image](https://user-images.githubusercontent.com/48171810/192154314-2cc8ac51-9dad-474f-a84b-3a1d98973215.png)

![image](https://user-images.githubusercontent.com/48171810/192154316-457a7ee0-b5a4-4a40-b48e-8863114da735.png)
2022-09-25 12:50:51 -04:00
water111 edecac9f09
[decomp] add shrubbery renderer (#1914)
as with last time, fog and time of day are still garbage, but it still
works:


![image](https://user-images.githubusercontent.com/48171810/192119423-91b80500-a161-42ce-b734-0c528cc721cf.png)

The shrub near render is just falling back to generic again.
2022-09-24 17:46:13 -04:00
water111 80cefb9575
[decomp] background and tfrag (#1909) 2022-09-24 14:30:44 -04:00
water111 6a1bde4168
[decomp] fix up debug menu rendering, add a few others (#1892)
![image](https://user-images.githubusercontent.com/48171810/190832869-e609d346-9c4a-43fb-ad94-2a9690521adc.png)
actor vis boxes for PRI.DGO
2022-09-16 20:42:33 -04:00
water111 4eea31c3e9
[jak 2] texture (#1866)
- Decompile and patch `texture.gc` for PC
- Improve decompiler when offset doesn't fit in immediate (for types
larger than 8k and some scratchpad accesses)
- Fix symbol->string issues in both jak 1 and 2
- Fix bug with VIF interrupt used to profile VU code (hooked up to
OpenGLRenderer BucketRenderers in PC port)
- Support `~o` in `format`.
- Uncomment stuff in `merc.gc` that now works!

![image](https://user-images.githubusercontent.com/48171810/189505469-941b4a3e-23c7-4740-aa1b-2e461ed19fa9.png)

fixes https://github.com/open-goal/jak-project/issues/1850
2022-09-11 14:17:55 -04:00
animalstyletaco 813611e0b2
Fixed typo in gfx.cpp (#1868)
Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2022-09-11 18:31:41 +01:00
water111 b5d21be9c5
W/misc fixes (#1838)
* temp

* temp

* before cleaning up

* cleanup merge

* fix warnings

* merge fix

* clang format
2022-09-05 20:29:12 -04:00
ManDude 0d16a52854
fix some pc settings not being saved/loaded correctly (#1815)
* Update default-menu.gc

* make fog hack slightly less aggressive

* add `reload-text` back but kinda fixed

* more unlocks for non-guaranteed musics

* smarter language save & load

* also save pc settings on autosave

* more special music log cases

* one more
2022-08-29 19:05:36 -04:00
animalstyletaco f86cc1a31f
Ast/kbm remapper update (#1800)
* Reverted default keyboard camera controls to IJKL and fixed bug where use mouse would always be set as false

* Fixed inverse axis on Right Y axis analog keyboard control

* Fixed newpad unit test, fixed variable typo, and fixed MapAnalog typo in newpad.h

Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2022-08-26 11:59:11 -04:00
water111 d7af0f0d30
fix opengl error when screenshotting with msaa off (#1795) 2022-08-23 20:37:59 -04:00
water111 be654b9398
fix tie lod and intro cutscene linux crash (#1794) 2022-08-23 19:14:21 -04:00
sardap 5777b6e058
Added screenshot hotkey (#1776)
* Added screenshot hotkey and added a toggle to debug GUI to disable screenshot hotkey (#1765)

* Renamed gfx_dumps folder to screenshots and screenshots taken with hotkey now use game render options not debug gui screenshot render options (#1765)

* Updated get current timestamp to use strftime

* fixed clang formating errors for screenshot hotkey

Co-authored-by: sardap <sardap@users.noreply.github.com>
2022-08-23 19:13:26 -04:00
Tyler Wilding 4164a755b1
game: fix transition from fullscreen (not borderless) to windowed (#1786)
* scripts: remove references to non-existent script

* game: fix transition from fullscreen (not borderless) to windowed

* game: ensure window is position away from the corner of the display when switching from fullscreen
2022-08-22 18:56:11 -04:00
water111 b388aa7b71
add option to disable mouse hiding (#1782)
* add option to disable mouse hiding

* write setting
2022-08-21 19:00:13 -04:00
Tyler Wilding dec7da2110
game: windowed mode related fixes (#1778)
* game: restore windowed mode settings properly

* game: use the game version for saving settings/saves

* game: prevent windowed mode from being auto-centered on initial init

* game: save and restore window coordinates

* lint: formatting
2022-08-21 18:13:27 -04:00
water111 3c89cd08be
Improvements for stuttering (#1768)
* tie changes

* other changes

* cleanpu

* remove silly profiling

* loader frames bug fix

* fix merge issue
2022-08-20 10:32:00 -04:00
animalstyletaco 0850c7d98c
Fixed invalid cursor mode bug in GLDisplay::update_cursor_visibility() (#1774)
* Fixed invalid cursor mode bug in GLDisplay::update_cursor_visibility()

* Removed global cursor mode variable

Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2022-08-20 10:31:39 -04:00
ManDude 7b25afa697
add a bunch of new cheat codes & re-do all pc cheat codes (#1770)
* redo cheat encodings

* fix error

* add no texture cheat

* tiny cleanup + add sidekick stats button

* crappy implementation of big/small head mode

* more correct bone scaling

* redo bone manip code a bit

* jp text fixes

* improved matrix math!

* add big fist cheat, minor type cleanup, add some debug toggles

* move all this mess to a new file

* slightly rework joint scaling function

* add big head npc cheat

* subtitles typo

* WIP mirror mode

* fix mirrored hud sprites

* fix mirror mode sound pan

* add cheats to menu!

* split some subtitles
2022-08-20 10:30:37 -04:00
animalstyletaco 375e9c7713
Added first working instance of controller/keyboard re-mapper (#1702)
* Added First working instance of controller/keyboard re-mapper

* Fixed clang formatting issues

* Updated newpad.cpp to inverse analog y-axis to make json labelling consistent

* Added mouse sensitivity options for X and Y axis in json, removed scroll mouse support, and other changes requested in feedback

* Added option to have ImGui debug menu appear on start up and remove hard coded set_imgui_visible calls

* Added newpad unit tests and updated function names to better describe intended functionalities

* Fixed formatting issue in newpad unit test

* Removed rumble unit test new pad

* Fixed codacy static analysis issues

* Fixed Linux build issues

* Implemented github feedback

* Implemented updated github feedback

* Fixed formatting errors

* Updated Pad::CheckPadIdx

* Implemented changes based on latest github feedback

* Implemented changes based on github feedback

Co-authored-by: animalstyletaco <animalstyletaco95@gmail.com>
2022-08-19 11:28:06 -04:00
Ziemas 2acc5250f8
Run IOP Vblank handler on the IOP thread (#1752) 2022-08-14 17:21:02 -04:00
ManDude 26f19e8b14
cleanup cheats menu + change game territory logic + some subtitles (#1733)
* use `game-text-id->string` function here

* small cleanup to pc progress code

* better way to handle "locked" texts

* this is better

* fix potential incompatibilities with merc & ocean renderers

* show cheat requirements in menu + change requirements

* increase size of money starburst

* split some more subtitles

* potentially fix a vsync bug?

* change territory encoding logic

* pass game territory to compiler

* ugh LOL
2022-08-06 11:57:19 -04:00
water111 da4ec008c3
Add a gltf level exporter (#1719)
* Add a gltf level exporter

* more fixes

* disable by default

* compile fixes for windows

* improve collide packer

* bug fix

* clang format

* fix texture bug
2022-08-05 12:25:35 -04:00
Tyler Wilding dc6589cef5
game/imgui: remove V-Sync checkbox as it can't be interacted with (#1726) 2022-08-05 12:12:55 -04:00
Ethan Lafrenais 88856ba5e0
Add in-game option to switch fullscreen monitor (#1700)
* Add in-game option to switch fullscreen monitor

* mmm undefined memory :)

* Fix type consistency

* Optimize get_monitor and get_monitor_count since they're called often

* Address PR feedback

* Track fullscreen mode and minimized state to reduce GLFW calls per frame
2022-07-31 13:31:17 -04:00
ManDude 9f6c4bd409
[game] improved subtitle debugging & make subtitles larger (#1704)
* improved subtitle debugging and interface

* increase subtitle font size

* fix a ton of subtitles

* dont toggle subtitles in scenes with no subtitles
2022-07-27 21:38:52 +01:00
ManDude a8653f7595
fix borderless on Windows, resolution when letterboxes and envmap setting (#1683)
* fix Windows borderless and letterboxing resolutions

* oops fix envmap setting

* unused

* fix msaa not using a resolve buffer

* remove unnecessary resolve buffers(?)

* fix sprite distort
2022-07-19 18:41:48 -04:00