1645 Commits
Author SHA1 Message Date
Nunuhara Cabbage 04333ad689 Merge pull request #378 from kichikuou/bb-misc
Miscellaneous changes for Busou Shoujotai Blade Briders
nightly
2026-09-21 20:42:53 -07:00
kichikuou 960c97ecc9 Update game_compatibility.md
- Mark Busou Shoujotai Blade Briders as supported.
- Extend the table through Rance X.
2026-09-22 11:19:26 +09:00
kichikuou e61f4b3c42 Math: Add Asin() and Acos() 2026-09-22 11:18:54 +09:00
kichikuou 03f9e7e87e Implement SystemService.GetSystemBufferName 2026-09-22 11:18:54 +09:00
Nunuhara Cabbage 87e4bebb12 Merge pull request #377 from kichikuou/SengokuRanceFont
SengokuRanceFont: Fall back to Gothic TTF for missing FNL glyphs
2026-09-21 19:09:55 -07:00
Nunuhara Cabbage 3a0dc49340 Merge pull request #376 from kichikuou/bb-parts
PartsEngine fixes for Busou Shoujotai Blade Briders
2026-09-21 19:09:37 -07:00
kichikuou e93cddad76 SengokuRanceFont: Fall back to Gothic TTF for missing FNL glyphs
SengokuRanceFont.DLL falls back to MS Gothic for characters whose glyphs
are absent from the FNL font. Reproduce this behavior to enable Japanese
translations of mods based on the MangaGamer release of Sengoku Rance.

Add an HLL-local composite font that wraps each selected FNL font_size
together with a FreeType Gothic font_size. The composite font checks for
each glyph in the FNL font and delegates rendering and size to Gothic
when the glyph is missing.

Scale fallback glyphs down and adjust their vertical position so that
they align with the FNL text line.
2026-09-22 10:24:48 +09:00
kichikuou 461eca1a85 parts: Inherit alpha clipper from parent parts
Move alpha_clipper_parts_no into inherited part parameters so child
parts use their parent's clipper unless they explicitly override it.

Bump the save version to 7.
2026-09-16 12:47:59 +09:00
kichikuou 6ea8af95ba parts: Fix global params after releasing a parent
parts_release detached children without marking them dirty, leaving
them with global parameters inherited from the released parent.
Furthermore, parts_update_component skipped global parameter updates
for parentless parts.

Mark orphaned children dirty and combine parentless parts against the
root parameters.
2026-09-16 12:46:07 +09:00
kichikuou 167d75d092 parts: Implement PartsFunc 112 (GetText) 2026-09-16 10:14:38 +09:00
kichikuou 275d71712e parts: Honor FLAT graphic key alignment
Offset the sprite so that the origin matches the anchor selected by the
graphic key's align field. Use the source rectangle dimensions when an
area is specified, and the full texture dimensions otherwise.
2026-09-16 10:14:37 +09:00
kichikuou d68baa74a0 parts: Save and load 3DLayer components
Serialize the SealEngine plugin bound to the component. Instances now
remember the name so referenced assets can be reloaded.

Bump the parts save format version to 6.
2026-09-16 10:14:26 +09:00
kichikuou 267f7bb762 parts: Support PartsFunc func_id assignments in Blade Briders
Blade Briders inserts three layer functions at func_id 3-5 into the
assignment used by Rance9, shifting all subsequent func_ids up by three.
Evenicle uses the same assignment as Blade Briders.

Use this assignment internally and add three to Rance9 func_ids before
dispatch. Also implement the functions 3-5.
2026-09-15 08:36:47 +09:00
kichikuou addc26ca45 parts: Implement PartsEngine.GetComponentSpeedupRateByMessageSkip 2026-09-15 08:36:39 +09:00
Nunuhara Cabbage bc745035e1 Merge pull request #375 from kichikuou/bb-3d
3D fixes for Busou Shoujotai Blade Briders
2026-09-13 08:05:01 -07:00
kichikuou 11ad7a583a 3d: Implement UV tiling
Read ColorMap UV tiling parameters from POL materials and apply separate
tiling factors to base and blend texture coordinates.
2026-09-13 11:20:54 +09:00
kichikuou 9654950ab4 3d: Implement SealEngine.SetDrawOption 1 (lighting)
When set to zero, render all meshes, including billboards and particle
meshes, as if they had the (nolighting) attribute.
2026-09-13 09:40:42 +09:00
kichikuou 021187752b 3d: Implement SealEngine.{Set,Get}InstanceGrayscaleRate
Add a per-instance grayscale rate that desaturates the final fragment
color after tone mapping.
2026-09-13 09:40:42 +09:00
kichikuou 5cc163ab16 3d: Load billboard frame images by name
In SealEngine, the frame images of a billboard instance are PNG files in
the archive, named "<name>\<basename>.png", "<name>\<basename>[1].png"
and so on, and the motion frame number is the index into them.

This also changes the lifetime management for billboard motions. A
billboard's motion holds the frame animation state of the instance,
which the game sets up before calling Load, so keep it across loads
and free it in free_instance.
2026-09-13 09:40:37 +09:00
kichikuou e14b4bca79 3d: Implement per-instance billboard vertices and UVs
Store the four billboard vertex positions and UVs in each RE_instance
and use them for regular billboard rendering. The static billboard mesh
is kept for billboard particles.
2026-09-12 11:00:57 +09:00
kichikuou 02f29b6c6d 3d: Implement SealEngine.{Set,Get}EdgeReductionRate 2026-09-12 11:00:49 +09:00
Nunuhara Cabbage fa09b0059f Implement PartsEngine.SetSpeedupRateByMessageSkip
Speeds up animations while message skipping.
2026-08-25 18:48:58 -07:00
Nunuhara Cabbage 4233c7d294 Fix EFFECT_CROSSFADE_MOSAIC
Long overdue fix for this effect, which is heavily used in Sengoku
Rance. The origin for the grid is now properly at the center of the
screen, as in the original engine.
2026-08-24 17:44:44 -07:00
Nunuhara Cabbage b30a107fda Implement EFFECT_VWAVE_SCROLL_CROSSFADE
This is the same as EFFECT_VWAVE_CROSSFADE, except with a different
maximum amplitude and the screen scrolls vertically.

(Used in Rance 9 when transitioning to a flashback scene.)
2026-08-23 10:39:03 -07:00
Nunuhara Cabbage bf3430dbad Improve EFFECT_VWAVE_CROSSFADE
Improve the math in this effect so that it matches Alicesoft's
implementation. This is almost a pixel-perfect recreation of the effect.
The only difference is that our waves are rendered with a smoother edge.
2026-08-23 10:11:29 -07:00
Nunuhara Cabbage 135cae216f Mitigate UI performance issue in Rance 9
Add a game-specific hack to mitigate poor performance when performing
certain UI operations in Rance 9.

Without this hack, the game creates an array of 990000 entries and then
calls Array.Find on it whenever it acquires or releases a parts number.
This was especially painful in debug builds, where the game would freeze
for 1-2 seconds when switching to the items screen for example.

The hack replaces the Array.Find calls with arithmetic.
2026-08-20 19:23:35 -07:00
Nunuhara Cabbage 05820dc536 parts: RemoveController returns delegate indices
The returned integer array contains p->delegate_index, not p->no.

I don't think this caused any bugs, because the game code rejects
returned indices that are > the delegate array length, and the delegate
index appears to always be -1 when this function is called.
2026-08-16 11:05:43 -07:00
Nunuhara Cabbage e76762d11d Implement EFFECT_DOWN_UP_CROSSFADE
Used in Rance 9 (when Hunty disappears).
2026-08-14 21:51:11 -07:00
Nunuhara Cabbage 5fb3c49f75 parts: clear cached font when rerendering text
Fixes an issue in Rance 9 (English version) where name plate text would
display at the wrong size.
2026-08-14 17:26:25 -07:00
Nunuhara Cabbage 5d032d739e Fix various memory leaks 2026-08-14 15:17:31 -07:00
Nunuhara Cabbage e3bf653165 Fix crash in Shaman's Sanctuary
Shaman's Sanctuary uses GoatGUIEngine.AddMotionCG with a CG index of 0
to clear the CG.
2026-08-14 12:40:00 -07:00
Nunuhara Cabbage a19c200870 parts: clean up text layout logic 2026-08-14 11:30:52 -07:00
Nunuhara Cabbage 5cbc697f23 parts: use bold width for text layout
Fixes the remaining issues with item descriptions in Rance 9.
2026-08-14 10:48:07 -07:00
Nunuhara Cabbage 4e20a499d4 parts: use ceilf(ch->advance) for text layout
Fixes an issue in English version of Rance 9 where item description text
was overly compressed. Now ChipmunkSpriteEngine.SP_GetFontWidth returns
the same values as the official engine.

There are still text layout bugs with item descriptions in Rance 9
(affecting both JP and EN versions), but this at least makes the text
readable.
2026-08-13 20:14:54 -07:00
Nunuhara Cabbage 0d4eb2a2a7 Merge pull request #373 from kichikuou/math-rand
Math: Replace rand() with mt19937
2026-08-13 18:28:18 -07:00
kichikuou d800e12f59 Math: Replace rand() with mt19937
On Windows RAND_MAX is 0x7fff, which makes Rand() and RandF() far too
coarse. Use mt19937 instead so that seeded sequences reproduce the
original engine's behavior.
2026-08-14 09:31:32 +09:00
Nunuhara Cabbage b1f8948b74 Merge pull request #372 from kichikuou/parts-load-text
parts: Fix loss of line breaks in saved multi-line text
2026-08-11 19:14:35 -07:00
Nunuhara Cabbage ebc319994e Merge pull request #371 from kichikuou/rance9-v2
parts: Reference construction process CGs by name
2026-08-11 19:13:18 -07:00
kichikuou 9bb871d9fd parts: Fix loss of line breaks in saved multi-line text
Text lines are saved individually without newlines. Insert an explicit
newline between lines on load so the original line structure is
restored. Also free the strings read from the save data.
2026-08-11 13:46:18 +09:00
kichikuou 62d38aaf59 parts: Reference construction process CGs by name
Rance 9's AFA archives have no ID field, so asset IDs are sequential
indices local to each archive. When the game loads an additional CG
archive, the ID spaces overlap: a name resolved to an ID against the
base archive later fetches a different CG from the additional archive.
Keep the CG name instead.

Bumps the save version to 5; version 4 and earlier saves still store IDs
and are converted on load.
2026-08-11 13:05:32 +09:00
Nunuhara Cabbage 5bb36c7524 Update libsys4
Fixes #370 via nunuhara/libsys4@cbc57ce
2026-08-09 19:00:36 -07:00
Nunuhara Cabbage 4dc9792632 Merge branch 'master' of github.com:nunuhara/xsystem4 2026-08-09 08:32:53 -07:00
Nunuhara Cabbage a7e973c0a9 Merge pull request #369 from kichikuou/rance9-v2
Resolve archive paths in asset_manager_load_archive
2026-08-08 20:09:26 -07:00
kichikuou 33f1295237 Resolve archive paths in asset_manager_load_archive
AFAFactory.LoadArchive passed the SJIS archive name straight through, so
the extra assets loaded by the Rance 9 v2.00 patch were never found.
Move the path resolution out of CGManager.LoadArchive so that both
callers share it.
2026-08-09 10:36:00 +09:00
Nunuhara Cabbage e699fb0aa2 DAP: ensure messages are null-terminated 2026-08-08 10:10:28 -07:00
Nunuhara Cabbage 4e0dd82776 Merge pull request #368 from kichikuou/libsys4
Update libsys4
2026-08-05 18:42:52 -07:00
kichikuou 77d9e77053 Update libsys4 2026-08-06 09:22:23 +09:00
Nunuhara Cabbage d65a1e6d9b Merge pull request #367 from kichikuou/rance9
game_compatibility.md: Add Rance 9 (JA) as supported
2026-08-04 18:50:56 -07:00
kichikuou 68e8257c27 game_compatibility.md: Add Rance 9 (JA) as supported 2026-08-04 20:52:41 +09:00
Nunuhara Cabbage 8e339d1537 Merge pull request #366 from kichikuou/save
PartsEngine: Stabilize save format for Rance 9
2026-08-02 11:12:12 -07:00