Commit graph

2133 commits

Author SHA1 Message Date
ManDude 53050fabc1
[jak2] allow going to metal head nest after winning game (#2753)
This is a major deviation from the original game, which did not have any
way to access the nest after beating Metal Kor as the air train gets
hidden when he is beaten. This was mostly annoying because there are
precursor orbs in that level that you might miss.

This makes it so the air train can once again be used to enter the nest
even after beating Metal Kor. The rest of the level remains mostly the
same, except the Rift Ring does not spawn and an invisible wall is added
to the Metal Kor arena to prevent you from entering it as you are
normally unable to leave it anyway.
2023-06-19 19:58:01 +01:00
ManDude 910681bde8
fix windowed screenshots capturing the last window buffer instead of current one (#2750) 2023-06-19 15:33:51 +01:00
ManDude 572e63f4a9
opengl: better handling of the draw region setting (#2746)
This fixes screenshots and a bunch of weird scissoring bugs. Fixes #2630
and fixes #2631
2023-06-19 04:15:33 +01:00
Tyler Wilding a8a5f1e745
formatter: support comments better (including block comments) and constant pair formatting (#2745) 2023-06-18 17:19:35 -04:00
ManDude c41a66829f
Make screenshots copy to clipboard (#2739)
Fixes #2728
2023-06-17 23:42:52 +01:00
water111 01cb9efccc
[jak2] fge=0 at the start of warp (#2740)
The warp giftags don't set PRE and seem to rely on fogging being
disabled at the start.
2023-06-17 18:29:55 -04:00
water111 6e779d1f1c
[jak2] faster startup (#2738)
Trying to make up for some of the startup speed lost in the SDL
transition. This saves about 1s from start (from ~3s), and about 500 MB
of RAM.

- Faster TIE unpack by merging matrix groups, more efficient vertex
transforms, and skipping normal transforms on groups with no normals.
- Refactor generic merc and merc to use a single renderer with multiple
interfaces, rather than many renderers. Removed "LightningRenderer" as a
special thing, but Warp is still special
- Add more profiling stuff to startup and the loader.
- Remove `SDL_INIT_HAPTIC` - this turned out to be needed for
force-feedback steering wheels, and not needed for controller vibration
- Switched `vag-player` to use quicksort instead of the default GOAL
sort (very slow)
2023-06-17 17:23:25 -04:00
BreakPoints 1512c6bd9c
sdl: Directly use Windows DPI scaling hint, not SDL (#2730)
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-06-17 12:40:25 -04:00
Hat Kid d8cca2bf83
game: refactor discord code and improve jak 2 support (#2714)
The Discord RPC code has been cleaned up and split up between game
versions.

For Jak 2, the Discord integration now shows large images for all levels
(with corresponding day and nighttime variants if required) and small
images for time of day and various states like being on the jetboard,
driving a zoomer, playing as Daxter, etc.

TODO:
- [x] mission specific images and detection
- [x] detect side missions properly
- [x] `onin-game` detection


![image](https://github.com/open-goal/jak-project/assets/6624576/35ec273f-404c-4475-a7c7-06121a17b1a5)

![image](https://github.com/open-goal/jak-project/assets/6624576/8456f5e2-4f96-4c72-ae9e-d930d76c93af)

![image](https://github.com/open-goal/jak-project/assets/6624576/9a17a0ec-c9bd-40fa-8556-f139712d8f07)

---------

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-06-17 05:16:40 +01:00
Matt Dallmeyer 2624934e72
Camera debug menu - reuse enum instead of strange indexing/magic numbers (#2717) 2023-06-15 20:28:54 +01:00
Matt Dallmeyer ccaa1f41e5
Rename collide-action enum values for readability (#2712)
```lisp
(defenum collide-action
  :type uint32
  :bitfield #t
  (solid 0)              ;; used for solid things
  (rider-plat-sticky 1)  ;; used for platforms in rider/platform interactions
  (rider-target 2)       ;; used for target in rider/platform interactions
  (edgegrab-active 3)    ;; set/cleared when entering/exiting edgegrab states
  (rider-plat 4)         ;; used for platforms in rider/platform interactions
  (unused 5)             ;; totally unused?
  (edgegrab-possible 6)  ;; used when edge grab checks should be done
  (edgegrab-cam 7)       ;; set/cleared when entering/exiting edgegrab states
  (swingpole-active 8)   ;; set/cleared when entering/exiting swingpole states
  (racer 9)              ;; set/cleared when entering/exiting racer states
  (attackable 10)        ;; used for something to do with attacking/damaging
  (attackable-unused 11) ;; seems to relate to attacking - set in several places but never tested for?
  (snowball 12)          ;; set/cleared when entering/exiting snowball states
  (tube 13)              ;; set/cleared when entering/exiting tube states
  (flut 14)              ;; set/cleared when entering/exiting flutflut states
  (racer-grounded 15)    ;; set/cleared when entering/exiting certain racer states w/ extra conditions
  (racer-unused 16)      ;; seems to relate to racer - never set, only cleared in one place?
  )
```
2023-06-15 19:59:54 +01:00
ManDude f0fb6f422d
fix some enter-states and sound-id fields (#2727)
Supersedes #2525
2023-06-14 22:04:00 +01:00
OpenGOAL Bot 45bbefafde
CI: Periodic Controller Database Update (#2718)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-06-13 21:46:23 -04:00
BreakPoints 756fcc3e4d
SDL: Hint to Windows that we handle DPI scaling (#2729) 2023-06-13 21:45:57 -04:00
ManDude e2c84d7635
revamp controller LED in jak 1 + reorganize some pc-settings things + fix some jak 2 decomp (#2719) 2023-06-13 19:26:44 +01:00
Ziemas 1eec021593
989snd: properly update children with new state (#2720) 2023-06-13 00:48:09 +01:00
water111 ad5cec1bb4
[jak2] Floating point blerc (#2715)
This moves the blerc math from mips2c to the Merc2 renderer, and uses
floats instead.

We could potentially do this on the GPU, which would be even faster, but
this isn't that slow in the first place.
2023-06-11 12:35:08 -04:00
Matt Dallmeyer a88c2d2460
Replace hardcoded pickup-type ints with enum name (#2704)
For reference:
jak1
```lisp
(defenum pickup-type
  (none) ;; 0
  (eco-yellow) ;; 1
  (eco-red) ;; 2
  (eco-blue) ;; 3
  (eco-green) ;; 4
  (money) ;; 5
  (fuel-cell) ;; 6
  (eco-pill) ;; 7
  (buzzer) ;; 8
  (eco-pill-random) ;; 9
  )
```

jak2
```lisp
(defenum pickup-type
  :bitfield #f
  :type int32
  (none            0)
  (eco-yellow      1)
  (eco-red         2)
  (eco-blue        3)
  (eco-dark        4)
  (eco-green       5)
  (eco-pill-green  6)
  (eco-pill-dark   7)
  (eco-pill-random 8)
  (money           9)
  (fuel-cell      10)
  (buzzer         11)
  (darkjak        12)
  (ammo-yellow    13)
  (ammo-red       14)
  (ammo-blue      15)
  (ammo-dark      16)
  (shield         17)
  (health         18)
  (trick-point    19)
  (trick-judge    20)
  (gem            21)
  (skill          22)
  (karma          23)
  (gun-red        24)
  (gun-yellow     25)
  (gun-blue       26)
  (gun-dark       27)
  (board          28)
  (pass-red       29)
  (pass-green     30)
  (pass-yellow    31)
  (pass-blue      32)
  (ammo-random    33)
  )
```

Co-authored-by: Tyler Wilding <xTVaser@users.noreply.github.com>
2023-06-10 01:39:13 +01:00
Tyler Wilding 1dbfd0e238
ci: fix chocolately, version number doesn't have a v prefix (#2711) 2023-06-09 13:55:50 -04:00
ManDude a17c78cdd1
don't use gender for citizen names + small minor stuff (#2708)
It's ultimately not useful information and kind of clutters the text.
2023-06-09 05:56:46 +01:00
Tyler Wilding 7f377000dc
nREPL: fix some logs and some spots where it could get stuck (#2709) 2023-06-09 00:02:07 -04:00
Tyler Wilding 33bf73636b
ci: update chocolately syntax and update nasm to 2.16.1 (#2710) 2023-06-09 00:01:50 -04:00
ManDude f5ad85b4cd
workaround for spyder warp hack and fix battle bugs (#2707)
Fixes #2705 
Fixes #2706
2023-06-08 06:47:44 +01:00
ManDude 18ddd1613c
Jak 2 pc subtitle support (#2672)
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>
2023-06-08 01:04:16 +01:00
Tyler Wilding 3dbaee1ecc
formatter: handle top level blank lines and better handle comments (#2702) 2023-06-06 20:34:50 -04:00
Tyler Wilding 3ecb3e4bc8
ci: don't run CI builds on non master branch pushes (#2703) 2023-06-06 20:05:35 -04:00
water111 b1e753740c
[jak2] joint to bone nan fix (#2698)
Fixes https://github.com/open-goal/jak-project/issues/2477
(and any other case of bad bones/cspaces when a bone's scale is very
small/negative)
2023-06-05 22:02:17 -04:00
water111 3bb6bd0e3a
[jak2] fix missing drill crane center part (#2692)
We were forcing the drill crane to draw at lod 0, but we should have
listened to the game and drawn it at lod 1.
2023-06-05 18:56:26 -04:00
Tyler Wilding e9f9869849
input: fix some mistakes in the default keyboard binds (#2697) 2023-06-05 18:26:29 -04:00
Hat Kid c677b716b9
readme: add mesa-libGL-devel dependency for fedora users (#2696) 2023-06-05 12:43:23 +02:00
ZedB0T 4bb5491d38
sdl: Fix target-fps add debug toggle for speedrun mode (#2694) 2023-06-04 20:42:09 -04:00
Tyler Wilding 2dead49019
sdl2: add back x11 window code fix (#2691) 2023-06-04 20:29:16 -04:00
Tyler Wilding bdaf088d4b
game: Migrate from GLFW to SDL2 & attempt to rewrite / simplify display and input code (#2397)
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-06-04 15:34:37 -04:00
water111 08741f0a42
[jak2] float patch for bogus collide frags (#2686)
Should fix https://github.com/open-goal/jak-project/issues/2679

Here's a test program that will trigger the bug when near these guards:
```lisp
(define *cquery* (new 'global 'collide-query))

(defun test-bad-collide ()
  (let ((lower (new 'static 'vector  :x 1681893.8750  :y 61314.2031 :z 345208.6562 :w 1.))
        (upper (new 'static 'vector :x 1701603.8750 :y  67624.0625 :z 357881.0312 :w 1.))
        ;(cquery (new 'stack-no-clear 'collide-query))
        )
    (set! (-> *cquery* collide-with) (the-as collide-spec 1))
    (set! (-> *cquery* ignore-process0) #f)
    (set! (-> *cquery* ignore-process1) #f)
    (set! (-> *cquery* ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
    (set! (-> *cquery* action-mask) (collide-action solid))
    (set! (-> *cquery* bbox min quad) (-> lower quad))
    (set! (-> *cquery* bbox max quad) (-> upper quad))
    (format 0 "doing collide...~%")
    (fill-using-bounding-box *collide-cache* *cquery*)
    (format 0 "have ~d and ~d~%" (-> *collide-cache* num-tris) (-> *collide-cache* num-prims))
    )
  (none)
  )
```

As far as I can tell, there's a totally invalid collide-hash with an
inside `axis-scale.z`. On the PS2, it gets ignore because of how
float->int works for floats that are too big. On PC, it ends up using a
negative value and loop forever.
2023-06-04 15:19:08 -04:00
Tyler Wilding 6eaa95608e
ci: bump timeouts on builds, mostly for cache misses (#2690) 2023-06-04 14:08:35 -04:00
Tyler Wilding 6d620a9289
formatter: extract formatting into a rules abstraction, add inner formatting (body vs argument functions) (#2684) 2023-06-04 13:19:29 -04:00
ZedB0T d41858c61c
Show the git commit version in screenshots/videos [Jak 2] (#2677)
With issues/screenshots becoming more common its probably time to turn
this on for debugging reasons.
2023-06-04 11:02:51 -04:00
Matt Dallmeyer 45b83ad5d5
Add race-bike-d/e debug options, some comments (#2683) 2023-06-04 10:57:53 -04:00
water111 fee91d2240
[IOP] revert change that ran the iop way too much (#2681)
This caused the IOP thread to use a full core always, just spinning on
this. I didn't mean to leave this in.
2023-06-04 10:57:34 -04:00
Hat Kid c23bef45bb
jak2: fix race crash (#2680) 2023-05-31 19:49:23 +02:00
Hat Kid 48141bee6f
jak2: fix pegasus crash (#2676) 2023-05-30 01:31:07 +02:00
Tyler Wilding 4c6982b0ec
formatter: initial and basic indentation/alignment and expose the formatting via the LSP (#2673) 2023-05-28 13:22:00 -04:00
Dimitri (__) ad0b3297ca
fix: add unicode tree-sitter include directory (#2674) 2023-05-28 13:21:25 -04:00
Ziemas 691af17bbd
overlord: Some cleanup (#2669)
Started cleaning up some of the lower hanging fruit.
2023-05-26 17:55:10 -04:00
ManDude 25fd007233
Update font-color enum (#2670)
Gives proper names to almost every color. It is very apparent that some
colors are context-sensitive/made for a specific purpose, so those
colors were named after that purpose instead of a generic color name.
2023-05-24 06:57:05 +01:00
Tyler Wilding 057ae361bf
LSP: OpenGOAL Feature Support - Part 1 (#2668) 2023-05-21 17:24:23 -04:00
water111 d5951c2b11
[jak 2] Fix possible stereo desync in overlord (#2663)
Normally, when they allocate a VagCmd, they do a bunch of stuff to clear
all the status bits and reset things
in particular the InitVAGCmd function does a lot


![image](https://github.com/open-goal/jak-project/assets/48171810/9b355020-ad37-496c-9438-2f8d34f24e0a)

but for the stereo command, they do a lot less:

![image](https://github.com/open-goal/jak-project/assets/48171810/12a36712-0e68-4377-a6be-3bde82c2aa15)

Which means that the new_stereo_command can just have random status bits
left over from whatever the last user had.
we seem to end up in a state where byte21 is set, and this causes
everything else to be wrong and off-by-one dma transfer. My guess is
that the original game avoided this bug due to lucky timing that I don't
understand.

I think the fix of just clearing byte21 is ok because there's no way
that the old value of the byte is useful after the command is
repurposed.
2023-05-19 21:17:11 -04:00
Tyler Wilding a033119f1d
i18n: add MysticGamer23's swedish subtitles (#2667) 2023-05-19 21:06:24 -04:00
Tyler Wilding 18f162fcdf
New Crowdin updates (#2666) 2023-05-18 21:43:00 -04:00
Tyler Wilding 288c093913
i18n: Create a JSON subtitle format for translating via Crowdin (#2644) 2023-05-18 20:54:59 -04:00