From 35f643f376ca33ef0f3b5977d8592391bb52bb63 Mon Sep 17 00:00:00 2001 From: Addison Bair Date: Wed, 7 Oct 2026 04:55:33 +0000 Subject: [PATCH] Grow the widget and light volume pools for large games A plasma bolt is drawn by its light volume, a widget, and both pools were still the Xbox's: 64 widgets and 256 light volumes. Every assault rifle holds a light volume for its flashlight beam from when it is made, held or dropped. In network co-op the rifles left lying about are kept as garbage in proportion to the players, and garbage that any player can see is never collected, so a large game fills the widget pool and keeps it full; a client that joins a game in progress makes all the rifles at once and takes every slot. From then on widgets_new finds the pool full and skips the widget, so every bolt flies and hits unseen. - widgets 64 -> 2048 (HALO_PORT_MAXIMUM_WIDGETS) - light volumes 256 -> 2048 (HALO_PORT_MAXIMUM_LIGHT_VOLUMES); with only the widgets grown, the light volumes run out next At 128 players a game can hold about 1,000: the rifles in hand, the ones on the ground (garbage collection starts at 400 and keeps those in view) and the bolts and needles in the air. The CPU part of the game state grows by 38,144 bytes, to 18,242,828 (2,466,548 free). As with any pool size, saved games of earlier builds no longer load. --- port/linux/include/halo_port_capacity.h | 6 ++++++ source/objects/widgets/light_volumes.c | 2 +- source/objects/widgets/widgets.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/port/linux/include/halo_port_capacity.h b/port/linux/include/halo_port_capacity.h index 91d11a25..f602cb7a 100644 --- a/port/linux/include/halo_port_capacity.h +++ b/port/linux/include/halo_port_capacity.h @@ -58,6 +58,12 @@ objects, noncollideable objects, lights) */ #define HALO_PORT_MAXIMUM_AREA_OF_EFFECT_OBJECTS 256 /* (64) */ /* object references shared by all script object lists */ #define HALO_PORT_MAXIMUM_LISTED_OBJECTS_PER_MAP 1024 /* (128) */ +/* widgets (light volumes, antennas, flags, glows, lightning), each made with +its object and kept for its life: an assault rifle's flashlight beam, held or +dropped, and a plasma bolt's light volume; a full pool draws the object +without its widget */ +#define HALO_PORT_MAXIMUM_WIDGETS 2048 /* (64) */ +#define HALO_PORT_MAXIMUM_LIGHT_VOLUMES 2048 /* (256) */ /* ---------- effects, particles, lights and sounds */ diff --git a/source/objects/widgets/light_volumes.c b/source/objects/widgets/light_volumes.c index d6f36778..c0cca264 100644 --- a/source/objects/widgets/light_volumes.c +++ b/source/objects/widgets/light_volumes.c @@ -72,7 +72,7 @@ static struct light_volume_globals light_volume_globals = {0}; void light_volumes_initialize( void) { - light_volume_globals.light_volume_data = game_state_data_new("light volumes", 256, 8); + light_volume_globals.light_volume_data = game_state_data_new("light volumes", HALO_PORT_MAXIMUM_LIGHT_VOLUMES, 8); if (!light_volume_globals.light_volume_data) { display_assert( diff --git a/source/objects/widgets/widgets.c b/source/objects/widgets/widgets.c index 7c04f7e5..8be006c4 100644 --- a/source/objects/widgets/widgets.c +++ b/source/objects/widgets/widgets.c @@ -61,7 +61,7 @@ symbols in this file: enum { - MAXIMUM_WIDGETS_PER_MAP = 64 + MAXIMUM_WIDGETS_PER_MAP = HALO_PORT_MAXIMUM_WIDGETS }; /* ---------- macros */