Commit Graph

3779 Commits

Author SHA1 Message Date
scamiv c6bbaae522 Extend staging deployment lifetime 2026-05-26 21:58:45 +02:00
scamiv 6b813b4c91 Add motion mode selection to TerritoryLayer and TerritoryWebGLRenderer
- Introduced a dropdown UI in TerritoryLayer for selecting motion modes (euclidean, axisSnap, manhattan, chebyshev).
- Updated TerritoryWebGLRenderer to handle the new motion mode settings, enhancing rendering behavior based on selected modes.
- Enhanced shader logic to incorporate motion mode effects, improving visual representation of territory transitions.
- Updated logging to include the current motion mode for better tracking of rendering performance.
2026-05-26 20:15:05 +02:00
scamiv e0d0c001d8 Add debug controls for border visibility and seed sampling in TerritoryLayer and TerritoryWebGLRenderer
- Introduced UI elements in TerritoryLayer for toggling the visibility of static and all borders, as well as selecting seed sampling modes (none, 2x2, 3x3).
- Updated TerritoryWebGLRenderer to handle new debug options for border rendering and seed sampling, enhancing visual debugging capabilities.
- Enhanced shader logic to incorporate new debug settings, allowing for improved visualization of territory transitions and border behaviors.
- Improved logging to include new debug options for better tracking of rendering performance and state management.
2026-05-26 20:15:05 +02:00
scamiv d20a7fa060 Add contested drawing controls to TerritoryLayer and TerritoryWebGLRenderer
- Introduced UI elements for enabling contested drawing and selecting contest patterns (blueNoise, checkerboard, bayer4x4) in TerritoryLayer.
- Updated TerritoryWebGLRenderer to handle contest pattern modes and integrate them into the rendering logic.
- Enhanced shader logic to support new contest pattern modes for improved visual representation of contested territories.
- Added functionality to synchronize contest state and pattern mode between the UI and renderer.
2026-05-26 20:15:05 +02:00
scamiv 21f88d59e6 Add runtime debug controls for territory smoothing in TerritoryLayer
- Introduced a UI for adjusting triple buffering and interpolation delay modes.
- Implemented exponential moving average (EMA) for interpolation delay to enhance animation stability.
- Added functionality to save and restore the position of the smoothing debug UI.
- Enhanced logging to include new debug options for better tracking of territory rendering performance.
2026-05-26 20:15:04 +02:00
scamiv d2a0db5544 triple 2026-05-26 20:15:04 +02:00
scamiv 423ff61e35 Refactor interpolation logic in TerritoryLayer for accurate animation timing
- Adjusted the denominator calculation for interpolation to use the actual tick interval, allowing animations to scale correctly with tick speed.
- Removed the previous 250ms cap that caused early animation completion at slower tick speeds, improving visual fidelity during territory transitions.
2026-05-26 20:15:04 +02:00
scamiv 5bd4f70702 Refactor territory rendering logic in TerritoryWebGLRenderer for improved snapshot handling
- Updated shader logic to interpolate between old and new territory snapshots without blending.
- Enhanced displacement calculations for smoother transitions, ensuring accurate visual representation of territory changes.
- Improved border rendering logic to maintain visual clarity and reflect ownership accurately.
- Simplified comments for better understanding of the rendering process and territory state management.
2026-05-26 20:15:04 +02:00
scamiv 16d28bc46b Refactor shader logic in TerritoryWebGLRenderer for improved territory transition handling
- Updated seedAt function to clarify coordinate handling and improve readability.
- Enhanced distance calculations for smooth territory transitions, ensuring accurate visual representation.
- Improved border rendering logic to maintain a pixelated look while accurately reflecting territory ownership.
- Added debug visualization options to assist in tracking territory transitions during development.
2026-05-26 20:15:04 +02:00
scamiv 1a7d2ef3b9 Refactor shader logic in TerritoryWebGLRenderer for improved visual clarity
- Updated debug visualization options to enhance issue tracking during development.
- Simplified comments for better understanding of seed handling and animation behavior.
- Adjusted blending logic to maintain a pixelated look while ensuring smooth transitions between old and new territories.
- Improved border rendering logic to reflect stable territory edges without alpha blending.
2026-05-26 20:15:04 +02:00
scamiv 9f33a3145e Refactor shader logic in TerritoryWebGLRenderer for improved seed handling
- Updated comments to clarify the coordinate system differences when reading JFA textures.
- Simplified seed fetching logic by removing unnecessary Y-coordinate flips.
- Enhanced smooth blending calculations for territory transitions, ensuring better visual fidelity.
- Improved debug visualization options for better troubleshooting during development.
2026-05-26 20:15:04 +02:00
scamiv 68e6918172 less debug 2026-05-26 20:15:04 +02:00
scamiv 3a76a9b609 debug 2026-05-26 20:15:04 +02:00
scamiv e033c53c8b Enhance hover highlight functionality in TerritoryWebGLRenderer
- Introduced hoverStartTime to track the duration of player hover highlights.
- Implemented logic to disable hover highlights after a specified duration of 5000 ms.
- Updated setHoveredPlayerId method to reset hoverStartTime when a new player is hovered.
2026-05-26 20:15:04 +02:00
scamiv b234371b8e refine alternative view rendering
- Adjusted shader logic to only draw borders in alternative view
- Updated comments for better understanding of rendering behavior in alternative view mode.
- Simplified color blending
2026-05-26 20:15:03 +02:00
scamiv 0306d579ec Refactor smooth animation logic in TerritoryWebGLRenderer
- Updated seed validation checks to simplify smooth animation handling.
- Adjusted comments for clarity regarding seed conditions and animation behavior.
- Enhanced performance by skipping unnecessary computations when seed data is invalid.
2026-05-26 20:15:03 +02:00
scamiv d0a43bf372 Refactor TerritoryWebGLRenderer to improve seed handling logic
- Updated seed distance calculations to check for valid seeds before applying smooth logic, enhancing performance.
- Simplified color mixing and edge handling based on the presence of old and new seeds, improving visual fidelity during transitions.
- Streamlined shader logic to reduce unnecessary computations when no changes are detected.
2026-05-26 20:15:03 +02:00
scamiv 22f3f14ba6 Remove TerrainLayer and integrate terrain handling into TerritoryWebGLRenderer
- Deleted TerrainLayer class to streamline rendering architecture.
- Updated GameRenderer to remove TerrainLayer instantiation.
- Enhanced TerritoryWebGLRenderer to manage terrain textures and rendering directly.
- Added terrain texture handling and shader updates for improved visual fidelity.
- Introduced terrainView method in GameImpl and GameMap for terrain data access.
2026-05-26 20:15:03 +02:00
scamiv 5c2d783424 Enhance contest management in TerritoryLayer and TerritoryWebGLRenderer
- Introduced ENABLE_CONTEST_TRACKING constant to toggle contest tracking functionality.
- Updated TerritoryLayer to conditionally handle contest updates and rendering based on contestEnabled state.
- Refactored TerritoryWebGLRenderer to manage contest-related uploads and rendering based on contestEnabled flag.
- Improved shader logic to incorporate contestEnabled uniform for better control over contest rendering.
2026-05-26 20:13:36 +02:00
scamiv 6bb22ca571 refactor: remove contested territory smoke effects and add tile count tracking
- Remove unused GLSL noise functions (hash12, valueNoise, fbm) from TerritoryWebGLRenderer
- Remove contested fill smoke rendering code that used these noise functions
- Add contestTileCount field to TerritoryLayer to track total contested tiles
- Update debug output to include contest tile count for monitoring
2026-05-26 20:13:36 +02:00
scamiv 370d8eec7b Removed contest speed tracking and related properties from TerritoryLayer and TerritoryWebGLRenderer to simplify contest handling.
- Updated contest strength calculations to utilize troop counts directly, enhancing accuracy in contest dynamics.
- Streamlined rendering logic by eliminating unnecessary checks and textures related to contest speeds, improving performance and clarity.
- Refactored related methods to focus on contest strength, ensuring a more cohesive approach to contest state management.
2026-05-26 20:13:36 +02:00
scamiv c576c512b4 Implement change mask functionality in TerritoryWebGLRenderer
- Added support for change mask textures and framebuffers to track territory ownership changes.
- Introduced a new shader program for change mask processing, enhancing visual fidelity during transitions.
- Updated rendering logic to incorporate change mask updates, improving performance and accuracy in contested areas.
- Refactored related uniform and framebuffer management for better organization and clarity.
2026-05-26 20:13:36 +02:00
scamiv 4ce8ec14cc accept delay, use triplebuffer,
Refactor contest management in TerritoryLayer and TerritoryWebGLRenderer

- Updated contest duration handling to use ticks instead of milliseconds for improved precision.
- Introduced new tick-based state management for contest updates and rendering.
- Enhanced interpolation logic for smoother transitions between contest states.
- Removed obsolete smooth state handling and related properties to streamline code.
- Added support for older contest states in the WebGL renderer for better visual fidelity.
2026-05-26 20:13:36 +02:00
scamiv 1b8b4f1ce0 needs cleanup.
feat: Add view transforms and contest speed/strength visualization
- Add contest speed tracking with exponential moving average for dynamic contest visualization
- Add contest strength calculation based on attacker/defender troop ratios
- Implement view transform support (scale/offset) for zoom and pan functionality
- Add animated contest effects with noise-based cloud rendering
- Improve smooth territory transitions with better edge handling
- Add debug overlay for development with contest and rendering stats
- Refactor WebGL renderer to support world-space rendering instead of pixel-perfect
2026-05-26 20:13:36 +02:00
scamiv 247469661d Refactor TerritoryWebGLRenderer to simplify contest handling
- Removed unused variables and logic related to contest state, including attacker relations and border management.
- Streamlined rendering logic by eliminating unnecessary checks for contested states, improving code clarity and performance.
2026-05-26 20:13:36 +02:00
scamiv 9f71dcc4e9 Refactor contest duration management in TerritoryLayer and TerritoryWebGLRenderer
- Introduced a constant for default contest duration in TerritoryLayer
- Updated contest duration handling in TerritoryWebGLRenderer
2026-05-26 20:13:35 +02:00
scamiv f217b1e1ce Enhance TerritoryLayer and theme configuration with player highlight color
- Added playerHighlightColor method to Theme interface and implemented it in PastelTheme and PastelThemeDark classes.
- Updated TerritoryLayer to redraw when the theme changes, ensuring consistent visual updates.
- Modified hoverHighlightOptions to use the new player highlight color for improved territory visualization.
2026-05-26 20:13:35 +02:00
scamiv d5a6c8f7a0 minor cleanup 2026-05-26 20:13:35 +02:00
scamiv 2893f05b40 double-jfa distance smoothing 2026-05-26 20:13:35 +02:00
scamiv 95f81c9543 Refactor TerritoryLayer and TerritoryWebGLRenderer for improved smoothing management
- Removed redundant smooth state handling in TerritoryLayer, replacing it with a snapshot mechanism for smoother transitions.
- Updated rendering logic in TerritoryWebGLRenderer to utilize framebuffers for state management, enhancing performance and visual fidelity.
- Adjusted shader logic to accommodate new smoothing conditions and removed obsolete properties related to smooth state tracking.
2026-05-26 20:13:35 +02:00
scamiv 3beb0bc6b7 Implemented full‑res JFA smoothing for territory ownership changes and wired it into the layer update loop. The renderer now builds a distance field from the previous‑owner border on the GPU and blends old/new colors over the 100 ms window; contested areas still use their checkerboard effect and skip smoothing.
Details:

Added per‑tile smoothing state in TerritoryLayer.ts (prev owner + change mask + 100 ms timing) and feed progress into the renderer each frame.
Added JFA seed + ping‑pong passes, prevOwner/changeMask textures, and smooth uniforms in TerritoryWebGLRenderer.ts, plus shader blending based on JFA distance.
2026-05-26 20:13:35 +02:00
scamiv 45fde77747 Update contest duration 2026-05-26 20:13:35 +02:00
scamiv e606f099ba Refactor TerritoryLayer and TerritoryWebGLRenderer for contest management
- Introduced contest management in TerritoryLayer, replacing previous transition handling with a new system for managing contests between tile owners.
- Added methods to handle contest state, including starting, updating, and expiring contests.
- Updated TerritoryWebGLRenderer to support rendering contest data, including new textures and uniforms for contest owners, IDs, and times.
- Enhanced rendering logic to visually represent contest states, including color changes and border effects during contests.
2026-05-26 20:13:35 +02:00
scamiv 0b973bda77 Reused the quick‑info hover logic so territory highlighting now follows boats/ships too.
- Added shared hover helper in HoverInfo.ts (same rules as PlayerInfoOverlay, including nearby ships on water).
- PlayerInfoOverlay.ts now uses getHoverInfo(...) instead of its local hover logic.
- TerritoryLayer.ts now uses getHoverInfo(...) and highlights the unit owner when hovering ships/boats.
2026-05-26 20:13:35 +02:00
scamiv 972527c6fd Remove redundant handling 2026-05-26 20:02:01 +02:00
scamiv afd5607934 Refactor TerritoryLayer and TerritoryWebGLRenderer for enhanced transition management
- Updated transition handling in TerritoryLayer, replacing epoch and progress tracking with a more efficient system using arrays for start times and active masks.
- Introduced new methods to manage transition states and ensure proper initialization of transition data.
- Modified TerritoryWebGLRenderer to align with the new transition management, removing obsolete properties and updating uniform handling for transitions.
- Improved rendering logic to support smoother visual updates during tile transitions.
2026-05-26 20:02:01 +02:00
scamiv 7acf863c1a Removed the CanvasTerritoryRenderer and related logic
Refactor TerritoryLayer and Renderer for improved transition handling

- Removed unused imports and types, streamlining the TerritoryLayer code.
- Replaced the `TerritoryRendererStrategy` interface with direct usage of `TerritoryWebGLRenderer`.
- Enhanced transition management by introducing epoch and progress tracking for tile transitions.
- Updated rendering logic to utilize the new transition properties, ensuring smoother visual updates.
- Removed the CanvasTerritoryRenderer and related logic, consolidating rendering responsibilities within the WebGL renderer.
2026-05-26 20:02:00 +02:00
scamiv 75b2d6c582 Implement tile transition effects in TerritoryLayer
- Introduced a new `TileTransition` type to manage tile transitions.
- Added methods to handle the beginning and updating of tile transitions.
- Enhanced `TerritoryRenderer` interfaces to support transition progress.
- Updated `TerritoryWebGLRenderer` to manage transition textures and rendering.
- Modified `GameView` to track owner changes for tiles, enabling transition effects during gameplay.
2026-05-26 19:57:13 +02:00
scamiv 61c9e9d819 Enhance TerritoryLayer with palette signature management
- Added `lastPaletteSignature` to track palette changes.
- Implemented `computePaletteSignature()` to generate a unique signature based on player views and settings.
- Introduced `refreshPaletteIfNeeded()` to refresh the palette when the signature changes, ensuring visual consistency in the TerritoryLayer.
2026-05-26 19:56:02 +02:00
scamiv 64a72c21e9 v1-dev 2026-05-26 19:56:02 +02:00
evanpelle aeb8d60224 don't show clan tab on crazy games v0.31.12 2026-05-12 07:49:02 -07:00
Evan ead2601623 Show bonus amount on currency packs (#3907)
## Description:

Show bonus amount on currency packs

- Add `bonusAmount` field to `PackSchema` (non-negative int)
- Render a rotated green corner ribbon (`+X FREE!`) on pack tiles when
`bonusAmount > 0`
- Add `cosmetics.free` translation key with `numFree` param

<img width="720" height="359" alt="Screenshot 2026-05-12 at 7 40 12 AM"
src="https://github.com/user-attachments/assets/3dd70fc4-c922-47f4-aee6-055047b58563"
/>

Describe the PR.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-05-12 07:44:44 -07:00
iamlewis 96e8f5cccd Update privacy policy and terms of service (#3897) v0.31.11 2026-05-11 12:58:28 +01:00
Patrick Plays Badly a3f695ee54 Update dyslexdria map (#3886)
## Description:
Small update to Dylexdria.
Iceland (island) moved for better game play.
Edits to nation locations and additional nations added.
Entire map shifted ~120 pixels for balance reasons. 


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:
PlaysBadly

---------

Co-authored-by: Ricky G.P. <realtacoco@gmail.com>
v0.31.10
2026-05-08 14:48:29 -07:00
Ryan 7873bdbcb4 clan stats breakdown (#3869)
## Description:

improvements to clan ui. 
<img width="788" height="290" alt="image"
src="https://github.com/user-attachments/assets/736ca147-bff4-44d8-8180-7b80a85556fe"
/>
added "expand all" and new collapsible sections.


<img width="787" height="550" alt="image"
src="https://github.com/user-attachments/assets/deb2f813-854b-46a9-a767-52c4f749f30f"
/>

which changes to collapse all when expanded

also adds more info about team (d,t,q,2,3,4,5,6,7 team)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
2026-05-06 16:10:27 -06:00
Ryan 9ab817cc89 [bugfix] fixes border around clans ui (#3873)
## Description:

fixes border around clans ui
<img width="67" height="705" alt="image"
src="https://github.com/user-attachments/assets/5ee35eb5-b406-4403-b9b4-324769faf061"
/>


also fixes weird padding:
<img width="134" height="244" alt="image"
src="https://github.com/user-attachments/assets/32a84074-afa6-4e9a-98f1-e45aabe4aa2a"
/>

what it should be:
<img width="140" height="206" alt="image"
src="https://github.com/user-attachments/assets/b72b480e-c972-4495-b9da-5c3b411bf590"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
2026-05-06 16:10:21 -06:00
evanpelle 8769e85576 run map generate to update map files 2026-05-06 14:44:39 -06:00
Alex Jurkiewicz 365402bbc7 perf(map-generator): major CPU and memory optimisations (#3860)
## Description:

Five performance improvements to the map generator, measured on three
maps of increasing size. End-to-end time on `world` improved ~15×, heap
allocations ~19×.

| Map | Before | After | Speedup |
|-----|--------|-------|---------|
| bosphorusstraits (~612K tiles) | 578ms / 594MB | 45ms / 134MB | 13× /
4.4× |
| world (~2M tiles) | 2333ms / 2128MB | 150ms / 553MB | 15× / 3.8× |
| giantworldmap (~8M tiles) | 10701ms / 9300MB | 635ms / 2509MB | 17× /
3.7× |

Changes (one commit each):
- **`--workers` flag**: bounds concurrent map processing to limit peak
memory
- **Flat `[]bool` visited sets**: replaced `map[string]bool` keyed by
`fmt.Sprintf` with flat `[]bool` indexed `x*height+y` — the dominant
cost
- **`neighborCoords` with stack buffer**: eliminates per-call slice
allocation for neighbour lookups
- **`Terrain` struct 24→16 bytes**: field reorder + `uint8` type for
`TerrainType`
- **Nil buffers early**: releases image/terrain arrays as soon as
they're no longer needed
- **BFS mark-visited on push**: each tile enters the queue once instead
of up to 4×, halving queue memory


also fixes a bug (according to Claude):

Here's the bug: createMiniMap downscales by averaging/sampling 2x2
blocks, copying field values across — including Ocean=true from the
parent scale. When a single connected ocean at 1x splits into multiple
disconnected bodies at 4x (because narrow water channels disappear when
you halve resolution), those smaller fragments still carry Ocean=true
from the carryover. The 4x processWater call picks the new largest
fragment and sets it to Ocean=true, but never clears the others — so
multiple disconnected bodies end up flagged as Ocean.

This PR's fix: before the new BFS pass, zero out every Ocean flag, so
only the truly-largest body at the current scale ends up marked.

It's incidental to the perf work but it's a real semantic change — the
on-disk .bin files will differ from main on any map where ocean splits
across downscaling. The PR doesn't mention it, which is why I flagged
it.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 14:39:59 -06:00
Evan 30caea0c40 Add loading spinner while waiting for public lobbies to load (#3867)
## Description:

Loading spinner:


https://github.com/user-attachments/assets/9033b707-7499-4a52-b0c6-d96d8f331ee3


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-05-06 14:28:20 -06:00
Ryan a4c3d54217 [bugfix] add detailCache = null; (#3868)
## Description:

fixed issue when leaving and trying to rejoin a clan without a reload

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
2026-05-06 13:35:58 -06:00