Skip to content

Play a defeat sequence when a dungeon heart is destroyed - #197

Open
Rokk001 wants to merge 102 commits into
tomluchowski:shaders-improvementfrom
Rokk001:pr/defeat-sequence-2026-09-25
Open

Rokk001 wants to merge 102 commits into
tomluchowski:shaders-improvementfrom
Rokk001:pr/defeat-sequence-2026-09-25

Conversation

@Rokk001

@Rokk001 Rokk001 commented Sep 27, 2026 •

Copy link
Copy Markdown

What

When a player's dungeon heart is destroyed, the defeated player now gets a defeat sequence instead of only a chat message. The interface disappears, the camera cuts to the heart, the heart shakes and bursts into rubble, a swirl in the conqueror's colour crosses the platform and the screen fades to black. A debriefing follows with per-seat statistics and one button back to the main menu. The platform of the heart stays as a ruin. While the heart is damaged, the ring of the top-left badge shows its remaining health, and a one-time warning appears when it is in critical condition.

Addresses #5.

Changes

  • Heart health: the heart gets its own health pool of 10,000 per room tile (90,000 for the 3x3 heart). Workers no longer damage an enemy heart. A saved heart with the old health record is converted to the same share of the new maximum.
  • Health ring: the ring of the top-left badge shrinks with the remaining health of the player's heart and the badge glows while the heart is hit. The server sends the ring fraction and the exact HP at game start and after loading, when the fraction changes by at least one percentage point, whenever the exact HP changes (the hover tooltip), and immediately when the heart is destroyed.
  • Warning: one text message when a heart is hit at 11 % health or less; not sent on the killing hit, in the editor or to non-human players.
  • Messages: new playerDefeated (conqueror seat, heart tile) and levelStatistics server messages, sent to the defeated human player only.
  • Statistics: six per-seat counters (keepers defeated, creatures killed, heroes destroyed, rooms captured, items made, creatures converted) and a table in the debriefing.
  • Sequence: runs on a monotonic clock, blocks game input, and ends in the debriefing. The confirm button opens the main menu with the skirmish sub-menu after a short zoom.
  • Ruin: only the heart object is released; the floor stays and the seat still counts as having no dungeon core, so the existing defeat handling is unchanged.
  • Tests: ten new check scripts and adapted existing ones.

Depends on

#143. Until it is merged the diff also shows its commits; the new work is the last six commits.

Validation

  • The Release build succeeds for the full branch and for each of the commits.
  • 36 of 39 check scripts pass. The three that fail (construction hammer, construction preview, heart construction) fail the same way on the head of Protect dungeon hearts and target the core in combat #143.
  • The sequence, the ring and the new health pool were played through in game on a local build with further changes. This branch itself was compiled and checked but not yet run in game, so the look and timing of the sequence, the ring and the debriefing still need an in-game test here.
  • Not included: restart, replay and spectate options.

Supersedes #147, closed and force-pushed by mistake; recreated with the same content and cleaned-up commit trailers.

Rokk001 and others added 30 commits September 7, 2026 00:29
Embed per-monitor DPI awareness and maintain the verified OGRE 13.6.5 renderer patch required for context-safe window replacement, runtime GL options and correct fullscreen client geometry.

Validation: clean Release build, DPI and 3440x1440 fullscreen probes, three GL3Plus variants and the patch reverse check passed; version 0.7.1 remains unchanged because this is unreleased work and the project has no changelog.
Apply display, input, audio, gameplay, minimap, shadow and negotiated nickname changes to the running session while preserving rollback for failed window or input transitions and keeping the 3440x1440 navigation visible.

Validation: clean Release and Debug builds, packet tests, DPI, layout and GL3Plus probes passed; the user confirmed the reported resolution, fullscreen, cursor, flicker and navigation failures are fixed. Version 0.7.1 remains unchanged because this is unreleased work and the project has no changelog.
The spells tab put its ten buttons in a single row of 60 pixel squares running
out to x=700. The pane they live in is the window width minus the 200 pixels of
minimap, so at the 800 wide minimum window it is 600 pixels across, and the last
two spells, Weakness and the Eye of Evil, hung past its right edge where they
could be neither seen nor clicked. Only a window at least 900 wide showed the
whole row, and nothing said so.

The rooms tab solved the same problem long ago: two rows of 40 pixel buttons.
The spells tab now uses the same shape, five spells to a row, ending at x=300
with room to spare at any size the game accepts. The cooldown bar inside each
button now covers exactly its button too, instead of overhanging 20 pixels on
both sides, which with narrower buttons would have bled half way across the
neighbours.

The rooms tab had the tail of the same bug: the temple and portal buttons the
editor uses sat at x=570 to 690, past the same edge. They join the end of the
second row instead.

(cherry picked from commit 10db1cb)
This packages the accepted implementation without private development notes. No release version or changelog change is required for this unreleased contribution.
This packages the accepted implementation without private development notes. No release version or changelog change is required for this unreleased contribution.
This packages the accepted implementation without private development notes. No release version or changelog change is required for this unreleased contribution.
This packages the accepted implementation without private development notes. No release version or changelog change is required for this unreleased contribution.
…62408a1c296287d00f9e647306654deb35ca' into HEAD
This packages the accepted implementation without private development notes. No release version or changelog change is required for this unreleased contribution.
Replace the auto declarations introduced by this branch with explicit types,
as requested in issue tomluchowski#42 and required by the project coding guidelines. No behavioural change.
When an enemy hits a heart that is at or below 11 % of its durability,
the human owner receives one event message. No warning on the killing
hit, for AI or defeated owners, or in the editor.
When a human player loses the last dungeon heart, the server sends two
owner-only messages appended to ServerNotificationType: playerDefeated
with the conqueror seat and the heart tile, and levelStatistics with the
elapsed time and six per-seat counters (keepers defeated, creatures
killed, heroes destroyed, rooms captured, items made, creatures
converted). The counters are kept per seat on the server and are not
saved. The client stores the statistics and hands playerDefeated to a
new GameMode::startDefeatSequence entry point.
On playerDefeated the client hides the interface and pointer, blocks
input and cuts the camera to the destroyed heart. A client-only copy of
the heart shakes and bursts into particles and a rubble pile, a swirl
in the conqueror's colour leaves the heart, and a red tint, two
subtitles and a fade to black follow. The timeline runs on a monotonic
clock, so repeated frame callbacks do not speed it up.

On the black screen a debriefing window shows the player, the outcome,
the elapsed time and a per-seat statistics table from levelStatistics.
Its confirm button returns to the main menu, which zooms in briefly and
opens the skirmish sub-menu.
When a heart's health reaches 0, only the heart object is removed. The
room keeps its floor tiles as an inert ruin with no health, so the seat
has no temple any more and the existing defeat path runs as before. The
ruin cannot be attacked, its floor is never released in game mode, and
a saved ruin gets no new heart object on load.
The heart took its health from the durability of its floor tiles, so a
3 by 3 heart fell to a few blows. It now has 10000 health per room tile
(90000 for a 3 by 3 heart); the critical warning stays at 11 % of this
maximum. Only fighters damage an enemy heart: workers deal no damage to
it, and a worker given a non-creature target drops its fight action.

Saves write the heart health as "HeartHealth" on the new scale. An older
"HeartHP" record is converted to the same share of the new maximum, a
value above the maximum is limited to it, an unknown record is rejected
and a destroyed heart stays a ruin.
The green ring of the heart badge now shows the remaining heart health
of the local player as an arc, and the badge glows magenta for three
seconds after the heart was hit. The server sends the new owner-only
heartHealth notification (appended last to ServerNotificationType) when
the health fraction changed by at least one percentage point, when the
heart is destroyed and once when a game starts or is loaded. The client
redraws the badge into its existing texture with blitFromMemory, since
loadFromMemory would create a new texture that the badge never shows.

The badge drawing moves into drawBadgePixels, with the symbol test as a
named function instead of a lambda.
The badge icon still said "Your Mana". The heartHealth message now also
carries the current and maximum heart HP, the server sends it on every whole
HP change, and the client sets the icon tooltip and context line to
"Dungeon Heart: current/max" every frame. The badge tooltip in the layout
reads "Dungeon Heart Health" until the first message arrives.
Rokk001 added a commit to Rokk001/OpenDungeonsPlus that referenced this pull request Sep 29, 2026
The probe of check_dungeon_temple_duplication.py declared
RoomDungeonTemple::getHP() twice after the merge of tomluchowski#197 (defeat
sequence): the 10000 HP stub of the heart health work and the older
1.0 stub. A class with two identical member declarations does not
compile, so the check could not run. The old line
(test/construction-hammer-fixture) only keeps the 10000 HP stub since
186b569 (2026-09-27 02:21, 5x5 dungeon hearts), the later content
commit, so the older stub is removed here as well.

Files: source/tests/check_dungeon_temple_duplication.py.
@Rokk001
Rokk001 force-pushed the pr/defeat-sequence-2026-09-25 branch from bc819c9 to c1c1e6a Compare September 30, 2026 05:00
…th packets

A packet that is too short only triggered a log message and left the
conqueror seat, the heart tile, the seat count and the heart health values
uninitialised. They now start as unknown (-1, no seats, a full heart).
Pi, the notify tolerance, the golden angle of the rubble layout and the
shake, pulse and flicker frequencies get names. The arithmetic is unchanged.

This branch has not been deployed

No deployments
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.

2 participants