Commit graph

192 commits

Author SHA1 Message Date
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
Matt Penny 020b181499 Animate chamber 14 stairs
Added ascend/descend animation, triggers, and dynamic collision.

Next steps:
* Simplify collision (currently quite expensive)
* Destroy portals during ascend animation
2024-03-11 19:38:53 -04:00
Matt Penny 35e9d433a4 Read level animation sound from first specifying bone, and play from armature center
Removes multi-bone animation dependency on bone order for audio, and
allows the sound to play as long as one bone is still moving. The center
is also a more natural sound position.

This is needed for the chamber 14 stairs.
2024-03-13 01:03:41 -04:00
Matt Penny 6a1a7994b9 Avoid unnecessary signal definition
* Don't generate button cube signal if -1 or omitted
* Require button press, door, and box dropper signals to be specified
2024-03-02 22:03:13 -05:00
Deconimus 984dd65d2c fix fizzler optional signals generating unnecessary signals.
in test_chamber blender files, renamed @fizzler objects to not cause generation of unused signals.
removed "parse_trigger_signal" in trigger.lua, added "optional_signal_index_for_name", which is used for both trigger signals and fizzler signals.
added check in fizzler.c if signal is -1
2024-03-02 03:19:44 +01:00
Deconimus 3d37c2504c enabled fizzler objects to send signals on cube contact, the "@fizzler" objects in blender files now can have an argument for the signal name to send.
test_chamber_00: added level logic to trigger voice lines whenever the cube in the first room is fizzled.
added missing voice lines
box_dropper.c: fixed typo "DROPPER_.." instead of "DROOPER_.."

(Issue #13)
2024-02-28 13:32:44 +01:00
Matt Penny 79e77030c1 Fail explicitly when level armatures nest bones
Level animations use global coordinates, but sk_animation uses relative
offsets for child bones. Updating sk_animation to use global coordinates
works, but would break support for model animations (which use relative
offsets).

Although model animation export logic is currently implemented on the
C++ side and would not be immediately affected, eventually it'd be worth
it to move it over to Lua for simplicity and consistency.

So to avoid a future breaking change, and since complex armatures for
level animations are not likely to be needed, I'm leaving the current
behavior as-is until it is proven to be useful/necessary. Levels which
break this rule will now fail to export, to avoid surprises for anyone
who tries.
2024-02-11 18:41:14 -05:00
Matt Penny 725afb48c8 Do not use platform default encoding when generating subtitles
Windows uses cp1252, but we need UTF8. Specify it explicitly.
2024-01-08 22:42:05 -05:00
James Lambert ee42238411 Work on test chamber 08 2023-12-29 21:48:16 -07:00
lambertjamesd 61ed827764
Merge pull request #573 from mwpenny/save-deletion
Support save file deletion (#412)
2023-12-26 09:42:27 -07:00
Matt Penny 4f1a322c46 Confirm before deleting or overwriting save 2023-12-24 13:35:39 -05:00
Matt Penny 4e4a5e6ed0 Add menu icons and text for save/load/delete 2023-12-24 11:40:59 -05:00
James Lambert 0c141a9cff more profile work 2023-12-23 18:15:51 -07:00
James Lambert 7c2c1a62d5 Fix profiler 2023-12-23 13:46:00 -07:00
Joseph 77903a9395 reorganized the readme and move files.
I move contributing.md to the documentation folder.
I moved setup.sh to the tools folder.
I renamed contributing.md from all caps to lowercase to match other files.
I moved docker setup to it's own file.
I moved some instructions to the  add_vpk_here.md file.
2023-12-21 18:22:06 -05:00
Joseph a8f5ff8abc
Delete tools/romfix64.exe
I deleted romfix64.exe as it should no longer be needed.
2023-12-18 22:09:20 -05:00
carsongoodwin32 95b49f6ae0 relocate romfix.sh 2023-12-17 17:57:38 -06:00
James Lambert dcf5190ae9 Attempt to calculate expensive pixel heat map 2023-12-16 20:21:50 -07:00
James Lambert f41a919452 work on profile visualiziation 2023-12-16 19:19:24 -07:00
James Lambert d775df6b22 Have profiler label nested display lists 2023-12-12 18:00:47 -07:00
James Lambert af2240298f work on rsp profiler 2023-12-10 21:34:46 -07:00