212 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
d44be30079 Fix comment in font_converter.js 2025-01-07 16:06:17 -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
a029e1e442 Fix build when repo path contains spaces
* jsox.js:             Quote paths in sox command
* Toolchain-N64.cmake: Quote build directory in assembler include dir
2025-01-01 16:04:52 -05:00
Matt Penny
cdb150dd87 Turret model in game 2024-12-31 18:18:03 -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
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
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
13691d919a Move tools into subdirectories 2024-11-06 23:25:02 -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
a29bb36041 Do not rely on hardcoded directories when linking
* Use preprocessor directives to pass microcode object file paths

* Add build directory to include path when preprocessing, so directory
  name is not needed when including generated linker script fragments

* Pass required files on the command line so wildcard matching can be used

* Also remove special case for creating object file for boot code (use
  incbin in asm file instead)
2024-11-02 02:07:08 -04:00
Matt Penny
11a81e100f Refactor linker script segment generation
* Code for this now lives in one place instead of 3. This will make it
  easier to generate with CMake.
* Simplify subtitle alignment
2024-10-25 02:08:09 -04:00
Matt Penny
3b9fba522b Get Skeletool dependencies from system
Do not install while building
2024-10-19 21:18:14 -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
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
e1e6a53aa6 Convert models during CMake build
No generation of dynamic model lists yet
2024-10-05 01:54:55 -04:00
Matt Penny
fa0940fe90 Work on CMake conversion: test chambers
Incidental changes along the way:
* Move `export_level.lua` to `tools/level_scripts/`
* Small reorganizations/fixes to existing `CMakeLists.txt` files
* Support passing absolute paths to level export
2024-09-13 00:53:55 -04:00
Matt Penny
dea0c3591d Work on CMake conversion: sound transformation, conversion, and table generation
Some parts need to be cleaned up/removed/streamlined after the CMake
build can build the game on its own and compatibility with what the
old makefile does is no longer needed.
2024-09-12 02:17:28 -04:00
Matt Penny
0d2cd6efe0 Work on CMake conversion: sound transformation 2024-09-09 23:34:16 -04:00
Matt Penny
b999e139fa Work on CMake conversion: VPK extract and texture conversion 2024-09-06 01:26:08 -04:00
Matt Penny
ab56ffb380 Add can_see argument to whitelist visible rooms
Useful for room shapes which cannot be handled by standard visibility
checks.

Normally this can be addressed with additional rooms and doorways, but
sometimes a room is required to be a complex shape (for example, to
accomodate animated static geometry).

These instances should be few and far between, so leaving this as an
opt-in feature that can be used during level authoring.
2024-08-20 19:52:50 -04:00
Matt Penny
d5a1c302b1 Fix portal indicator HUD not working through multiple doorways
* Doorway normals now always point toward room A. This was intended
  and code was written for it, but typos prevented it from working.
* Consistent doorway directions allowed resurrection of previous
  collisionSceneRaycastDoorways() implementation
2024-08-20 17:37:29 -04:00
Matt Penny
e85ac2fdf1 Fix side room door visibility issue in chamber 15, and enforce one doorway per room pair
More doorways can be supported but it complicates the culling logic. It's
easy to work around so leaving unsupported for simplicity until needed.
2024-08-19 17:19:59 -04:00
Matt Penny
9822ffeac9 Support precise (i.e., rotated) culling of static geometry (#73)
Standard culling is quite coarse, for performance reasons:
* Only uses axis-aligned bounding boxes
* One visible object in a BVH node will make all others in the same node visible

These properties allow the bounding boxes of rotated objects to clip through
the back of portals to be considered visible, causing improper rendering.

This commit introduces a new optional argument for `@static` level
objects: `precise_culling`. Static geometry marked for precise culling
will be culled based on its exact (i.e., rotated) bounding box, in the
same way dynamic/animated geometry is.

Precise culling is more expensive than standard culling so it is opt-in.
It is intended only for the few situations that can hit the edge cases
described above.
2024-07-26 18:47:58 -04:00
Matt Penny
b29b5c2b8d Autogenerate static collision for fizzler sides (#70)
Eliminates the two stationary dynamic collision objects that were
previously used.

This change refactors entities.lua and collision_export.lua to support
autogenerated static collision for any object which may need it in the
future.
2024-06-06 23:39:56 -04:00
Matt Penny
3ed8552a9c Support vertically tiled fizzlers
Reduces dynamic object and dynamic collision object count.
2024-05-30 00:13:01 -04:00
Matt Penny
35f03488ef Fix static_export error message 2024-05-08 21:40:29 -04:00
Matt Penny
78107866ce Allow static overriding portalability on a per-surface basis 2024-05-08 20:46:42 -04:00
Matt Penny
bf5b8e0d28
Merge pull request #47 from GiacomoGarbin/replace_libnustd_with_glibc
Use newlib instead of libnustd.
2024-04-12 19:01:12 -04:00
Matt Penny
685f818114 Add material for water hazard wall 2024-04-11 19:55:34 -04:00
Matt Penny
8b69564561
Merge pull request #48 from mwpenny/chamber-14
Chamber 14 stair pit
2024-03-28 01:10:12 -04:00
Matt Penny
5603a1a23f Add material for transparent portal surfaces 2024-03-27 23:37:22 -04:00
Giacomo Garbin
22f017722d Remove libnustd from setup files. 2024-03-28 02:35:32 +01:00
Matt Penny
1fb2390a57
Merge pull request #43 from Deconimus/issue38_fizzler_width
Apply blender object scale to fizzlers
2024-03-26 12:47:36 -04:00
Deconimus
72c0220a3e tools/level_scripts/entities.lua: take fizzlers' mesh bounding box width into account, instead of only scale factor 2024-03-25 22:39:09 +01:00
Matt Penny
bba7d9add1 Confirm when loading game while in a level 2024-03-24 20:50:03 -04:00
Matt Penny
f3ab06c9dc Confirm when starting new game while in a level 2024-03-24 20:50:01 -04:00
Matt Penny
a3cde0c690 Confirm before quitting 2024-03-24 20:49:47 -04:00
Deconimus
5e6425075d make fizzler width scale with blender scale & fix rendering bug which used to cause fizzlers from disappearing at some viewing angles 2024-03-21 22:54:42 +01:00