527 Commits

Author SHA1 Message Date
Matt Penny
cc2f26ba81 Start on turret AI (grabbed state)
Also fixed some minor issues:
* Fix turret texture mirroring
* Further shorten command string for sound table generation
* Allow re-queuing same subtitle after it disappears
2025-02-15 21:13:35 -05:00
Matt Penny
0459a1d12d Switch object fixes
* Allow pressing switch during countdown to restart timer
* Fix button UV mapping
* Fix button pose position (default to unpressed)
* Play "button release" sound on timeout
2025-02-11 00:53:20 -05:00
Matt Penny
56a176be93 Fizzlable turrets 2025-02-06 01:53:17 -05:00
Matt Penny
e2029c21f8 Start on turret lasers 2025-01-28 00:18:10 -05:00
Matt Penny
1359e63063 Store generated code for strings and audio in codegen/assets/
Moved from codegen/src/ for consistency.
2025-01-07 14:29:56 -05:00
Matt Penny
eaf4097c9c cmake: Use .ims file to convert Valve logo image
Aligns with rest of original game textures. One less special case.
2025-01-06 14:29:56 -05:00
Matt Penny
5f64d6895e cmake: Fix VPK and texture dependencies 2025-01-01 16:45:44 -05:00
Matt Penny
a8c4692c69 Add missing turret model flags file 2024-12-31 18:20:52 -05:00
Matt Penny
cdb150dd87 Turret model in game 2024-12-31 18:18:03 -05:00
Matt Penny
e34d2e10df Add turret model and textures by @Pyr0xene 2024-12-31 18:13:51 -05:00
Matt Penny
03e3d31563 Start on turret model 2024-12-15 17:29:59 -05:00
Matt Penny
7819056f1c Chamber 16 vertex lighting and ambient sound 2024-12-07 23:43:53 -05:00
Matt Penny
96602ecc71 Fix VPK extraction when using Ninja
Builds failed if VPKs were not previously extracted since VPK contents
are not explicitly listed as custom command outputs. Specifying every
extracted file would mean duplicating content from the asset
CMakeLists.txt files and is also quite noisy (there are many files) for
little gain.

Instead, relax the dependencies around files sourced from VPKs. Now the
build just depends on the VPKs having been extracted and not the files
within. After all, these files should never change.

If Portal is updated with new VPKs, they will trigger re-extraction and
dependent targets will be rebuilt. Targets will NOT be rebuilt if users
modify original Portal game files in portal_pak_dir.
2024-12-06 00:29:11 -05:00
Matt Penny
a4f047f1d8 Chamber 16 collision and culling 2024-12-03 23:29:41 -05:00
Matt Penny
7e53d1206b Fix portal gun animation glitches
The skeletool command for model generation placed model flags before
default flags.

Normally this isn't a problem, but v_portalgun.flags overrides the
default scene scale by specifying the same argument again with a
different value. Since its arguments were not last in the command,
the scale was not overridden and its animations were incorrect.

Fixed by refactoring the convert_asset script into a more general
run_command script, which supports the required functionality of reading
arguments from a file while also allowing the caller to choose their
position relative to other arguments.
2024-11-29 00:40:20 -05:00
Matt Penny
c3a96fb854 Fill empty space in signage_overlay_midair1
Duplicate signage_overlay_turret so signage_overlay_midair2 does not
have empty white space below it. Otherwise, the border looks too white
in game.
2024-11-25 21:10:59 -05:00
Matt Penny
cb4b8b29c8 Finish modelling chamber 16
No Rattmann den or scrawlings for now.
No collision or culling.
2024-11-25 21:01:33 -05:00
Matt Penny
455f25b5d9 Fix build with Makefile CMake generator
* Create output directories before running skeletool
  - Was missing for levels and materials
* Update toolchain-specified assembler include directory
  - Change from project root to build output directory
  - Looks like this workaround isn't needed for the Ninja generator.
    Keep it to support the Makefile generator.
2024-11-23 02:02:13 -05:00
Matt Penny
a0a542965a Model beginning of chamber 16 2024-11-23 00:01:59 -05:00
Matt Penny
4ebba1f678 Fix chamber 14 stair pit grating display in Blender 2024-11-22 23:02:52 -05:00
Matt Penny
46762c3600 Match chamber 6 wall light cutouts to original game 2024-11-22 00:11:34 -05:00
Matt Penny
60c1588fff Fix window glass position in final room of chamber 15 2024-11-21 20:42:10 -05:00
Matt Penny
0fd1954898 Do not hard code build output directory name
The game can now be built in any directory
2024-11-20 23:38:24 -05:00
Matt Penny
bbb6f7b095 Add missing font characters for Polish and Romanian translations
* Also explicitly ignore non-breaking space
* Fail string generation if any font characters are missing
2024-11-20 21:43:01 -05:00
Matt Penny
5d482bbcd8 Sound conversion cleanup
* Use .sox files for ambience_base and tank_turret_loop1 instead of
  hard-coded conversion
* Rename .msox to .sox
  - Format is same and extension is no longer needed to differentiate
* Output transformed sounds to portal_pak_modified instead of build dir
  - Consistent with other conversions, and easy to preview when adding
    new sounds
  - Avoids hard-coding build output directory in .ins files
2024-11-18 23:00:20 -05:00
Matt Penny
e884e283fa CMake cleanup
* Use "strings" instead of "subtitles" for translation-related files and types
* Remove CMAKE preprocessor define
* Remove makefile hack in generate_sound_ids
2024-11-18 21:56:20 -05:00
Matt Penny
c35e2e64fc Remove Makefile and update build docs 2024-11-16 19:52:30 -05:00
Matt Penny
771c06d934 CMake: finish options for configuring languages
* AUDIO_LANGUAGES and TEXT_LANGUAGES are now validated against
  supported languages
* Alternately, "all" can be specified to include all languages
  (default for TEXT_LANGUAGES)
* Also fixed linker script not regenerating on language change

CMake builds now have parity with the Makefile (and more!)
2024-11-14 23:52:36 -05:00
Matt Penny
8853940a2a CMake: support configurable text languages
* Comma-separated languages can be specified using the TEXT_LANGUAGES
  CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language

As part of this, I cleaned up the string generation script, and fixed
some incorrect Bulgarian HINT_ strings.

TODO:
  * Allow specifying "all" for text/audio language
  * Invalid character validation
2024-11-14 23:50:20 -05:00
Matt Penny
1c6efda386 Generate font layout information during build
Removed generated font code from repo to avoid duplication and make
updating fonts cleaner. The files in `assets/fonts/` are the source
of truth.
2024-11-14 23:50:20 -05:00
Matt Penny
00559b6ca3 CMake: support multiple audio languages
* Comma-separated languages can be specified using the AUDIO_LANGUAGES
  CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language

As part of this, I refactored the sound lookup tables to not store
information about non-localized sounds (which previously occupied most
of the table).
2024-11-14 23:50:19 -05:00
Matt Penny
d07521f70a CMake: clean up linking
* Linker script file and preprocessing logic moved to subdirectory
* Linker script related flag passing moved to function in toolchain file
* ROM generation logic moved to toolchain file
2024-11-07 00:32:09 -05:00
Matt Penny
31ce4e17a0 Game builds with CMake 2024-11-06 01:38:18 -05:00
Matt Penny
13db5ddc5e CMake: generate linker script fragments for segments
* Animations
* Levels
* Dynamic models
* Strings

Started to hook this up to the linker. There are still some errors to fix.
2024-11-05 02:07:16 -05:00
Matt Penny
bbc5a686a6 CMake: reorganize code segment into separate library
Required for linker script.

Refactored some asset targets to make this possible.
2024-11-02 21:03:39 -04:00
Matt Penny
4c1484d5e6 Use PROJECT_BINARY_DIR instead of CMAKE_BINARY_DIR 2024-10-22 00:13:54 -04:00
Matt Penny
b04e404b0b CMake: finish skeletool integration
* Embed Lua scripts in a cross-platform way (generated C source files)
* Automatically find `luac`
* Automatically build skeletool when building main project
2024-10-21 22:50:17 -04:00
Matt Penny
42a9189c95 CMake: get assembly working
* Assemble through `gcc` instead of `as` directly, so source files are
  preprocessed (i.e., `#include`)
* `gcc` does not pass `-I` include directories to `as`. This can
  supposedly be fixed by recompiling `gcc` with `--with-gnu-as`. Popular
  N64 toolchain binary distributions don't do this, and to lower the
  barrier to entry I don't want to force users to have to compile their
  own. Work around it by passing `-Wa,-I`.
* CMake only finds assembly dependencies when preprocessing, not when
  assembling. Use `#include` instead of `.include` to work around this.
  The `.incbin`s used by `sound_data.s` are covered by the
  sound_data_tables target dependency.
2024-10-19 16:30:58 -04:00
Matt Penny
1cb12690b8 Fix UV mapping on elevator bottom edge 2024-10-17 21:20:01 -04:00
Matt Penny
22ea93d19f CMake: automatically find programs used in build
Blender 3.6 and ImageMagick 6 versions are also enforced
2024-10-17 21:04:48 -04:00
Matt Penny
08368ffa25 Remove mpg123 dependency
It was used to convert MP3 -> WAV, which ffmpeg can do.
2024-10-17 18:44:24 -04:00
Matt Penny
86aaad1b3b CMake: suppress sox warnings 2024-10-17 18:20:55 -04:00
Matt Penny
9546c509a8 CMake: generate and link localized strings 2024-10-10 01:14:17 -04:00
Matt Penny
08dc063227 Use proper default material for fleck_ash2
Previously, grav_flare was used (likely due to a copy/paste error),
resulting in a warning during build and unnecessary texture data
being included in the fleck_ash2 generated model.
2024-10-09 22:55:53 -04:00
Matt Penny
ddac6daeff CMake: prevent double work when using parallel make 2024-10-09 22:49:02 -04:00
Matt Penny
87f931a8e4 CMake: link level and model animation data 2024-10-09 21:57:39 -04:00
Matt Penny
6c625e39e6 CMake: link generated code 2024-10-08 00:25:30 -04:00
Matt Penny
1d0b22df61 Generate dynamic model lists with CMake, + refactor
* When building with CMake, dynamic model lists are now generated
* Factored common code out of generate_*_list.js files to deduplicate
* Better separated generated model lists from main game code
    `dynamic_asset_data.c` and `dynamic_animated_asset_data.c`
    previously #included the corresponding generated headers, and
    `dynamic_asset_loader.c` declared externs for the contents.

    This messiness was likely done so the generated code would be built
    automatically (the Makefile globs all C files under `src/`).

    Now, model list data is output to C source files which are built
    explicitly. This, with some refactoring, allows the previously
    mentioned source files and externs to be removed.

    This is a bit hacky in the Makefile but will be automatic under
    CMake by using target properties.
* Reorganized some files under `tools/`
2024-10-05 21:11:49 -04:00
Matt Penny
9643719a31 Fix incorrect variable name for Python executable in CMake build 2024-10-05 02:04:39 -04:00
Matt Penny
e1e6a53aa6 Convert models during CMake build
No generation of dynamic model lists yet
2024-10-05 01:54:55 -04:00