Skip to content

Collision List - Recursive -Clock#351

Merged
DCurrent merged 7 commits into
masterfrom
collision_list_to_array_refactor
Jul 11, 2026
Merged

Collision List - Recursive -Clock#351
DCurrent merged 7 commits into
masterfrom
collision_list_to_array_refactor

Conversation

@DCurrent

Copy link
Copy Markdown
Owner

Summary

This pull request refactors collision handling around a unified, fixed-slot collection model and includes supporting updates to collision commands, debug rendering, recursive effects, and script-accessible system time.

Collision boxes now use indexed array collections instead of linked lists. Each collection supports up to 64 entries and uses a 64-bit active mask, providing predictable lookup and iteration while still allowing creators to use sparse indexes.

Collision system

Replace linked-list collision storage with fixed array collections backed by active masks.
Support up to 64 collision instances in each collection.
Represent attack, body, and space collisions through the shared s_collision_instance structure.
Replace the previous attack- and body-specific collection types with s_collision_collection.
Remove legacy entity collision functions and properties as part of the transition toward space boxes.
Preserve indexed collision access for easier organization and sparse-index use.
Collision commands

Add coordinate-entry shortcuts for defining complete collision boxes on one line:

attack.coordinates x y width height depth_background depth_foreground
bbox.coordinates x y width height depth_background depth_foreground

These commands populate the full coordinate structure without requiring each coordinate property to be entered separately.

Collision debug display

Add a projected collision-debug display mode.
Draw collision depth as perspective wireframe boxes instead of filled shapes.
Correct Z projection so background and foreground depth are projected outward from the parent entity rather than centering the completed box around an already adjusted position.
Recursive effects

Recursive effects now use a middle ground between the previous unlimited linked list and the fixed array of 16 elements.

The entity structure has been restored to storing only a pointer, though it no longer points to a linked-list head node. Instead, a full collection of recursive-effect structures is lazy-allocated when an entity first receives a recursive effect.

The maximum number of simultaneously active effects on a single entity is now 64, allowing the collection to use a 64-bit active mask without increasing the resident size of every entity.

System datetime API

Add script-accessible system time support, including:

Unix timestamps in seconds and milliseconds.
Local and UTC time standards.
Numeric accessors for year, month, day, hour, minute, and second.
datetime_format() support for custom date and time formatting.
Optional caller-provided timestamps, with the current system time used by default.

DCurrent added 7 commits June 27, 2026 02:53
Rework collision structs and prototypes to restore attack and body boxes to fixed-slot collections backed by arrays and active masks.

This commit does not compile yet. Implementations still need to be updated to match the new collection API.
…tance model.

Collision boxes now use fixed array containers instead of linked lists, with each collection capped at 64 entries. Attack, body, and space collision boxes are represented through the shared `s_collision_instance` structure, while the previous attack/body-specific collection types have been replaced by `s_collision_collection`.

Legacy entity collision functions and properties were removed as part of the cleanup, with in-progress space boxes intended to replace their functionality. Collision debug display options were also expanded in `savedata.h`, including a new projected mode that draws perspective wireframe boxes for depth debugging.
…ed box instead of projecting Z front and bakc distances from parent entity.
Adds script-accessible system time support with Unix timestamps in seconds and milliseconds, plus local and UTC time standards.

Adds numeric datetime component accessors for gameplay logic, including year, month, day, hour, minute, and second. Also adds datetime_format() for strftime-style custom date/time output.

Component accessors and atetime_format() accept optional custom timestamps or default to the current system time. They also support local or UTC output.
…ted linked list and the fixed array of 16 elements. The entity structure has been restored to storing only a pointer, though it no longer points to a linked-list head node. Instead, a full collection of recursive-effect structures is lazy-allocated when an entity first receives a recursive effect. The maximum number of simultaneously active effects on a single entity is now 64, allowing the collection to use a 64-bit active mask.
@DCurrent DCurrent merged commit f23d173 into master Jul 11, 2026
8 checks passed
@DCurrent DCurrent deleted the collision_list_to_array_refactor branch July 11, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant