Skip to content

Add rotating Adventure battle backgrounds - #11392

Open
vanja-ivancevic wants to merge 7 commits into
Card-Forge:masterfrom
vanja-ivancevic:feat/BG-rotation
Open

Add rotating Adventure battle backgrounds#11392
vanja-ivancevic wants to merge 7 commits into
Card-Forge:masterfrom
vanja-ivancevic:feat/BG-rotation

Conversation

@vanja-ivancevic

@vanja-ivancevic vanja-ivancevic commented Jul 25, 2026

Copy link
Copy Markdown
Contributor
  • Rotates through any number of JPG, JPEG, or PNG battle backgrounds in a folder and avoids immediate repeats when alternatives are available.
  • Uses one HTTPS URL in <plane>/skin/battle-backgrounds.txt. That URL points to a plain-text index whose non-comment lines are relative image paths.
  • Maps every indexed path in two matching places. For example, enemy/lich/lich_01.jpg is fetched relative to the index URL and stored under <plane cache>/skin/battle_backgrounds/enemy/lich/lich_01.jpg.
  • Downloads only missing images when the Adventure plane starts, removes cached images no longer listed, and uses the last valid cached index during temporary host failures.
  • Generates stable path-safe folders from canonical point-of-interest names, enemy names, and TMX map paths, so publishing new art normally requires only adding files and index entries on the host.
  • Checks folders in this exact priority order, stopping at the first folder containing images: (1) TMX enemy battleBackground, (2) encounter/<poi>/<enemy>, (3) enemy archetype battleBackground, (4) enemy/<enemy>, (5) TMX map battleBackground, (6) map/<poi>/<map>, (7) map/<map>, (8) point-of-interest battleBackground, (9) poi/<poi>, (10) <category>/<biome>, and (11) <category>.
  • For each candidate folder, checks the plane cache, local plane files, then common Adventure files. If no rotation folder contains an image, the existing plane, common, current-skin, and default-skin single-image fallbacks remain unchanged.
  • Keeps Old Border artwork on the Old Border Shandalar website instead of adding it to the Forge distribution, while leaving the same system available to other Adventure planes and mods.

@vanja-ivancevic vanja-ivancevic changed the title Old Border Shandalar: Add rotating Adventure battle backgrounds Add rotating Adventure battle backgrounds Jul 25, 2026
@vanja-ivancevic vanja-ivancevic changed the title Add rotating Adventure battle backgrounds Add rotating Adventure battle backgrounds + new BGs for Old Border Shandalar Jul 25, 2026
@tool4ever tool4ever added the GUI label Jul 25, 2026

@tool4ever tool4ever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, though this adds yet another ~20MB of extra assets to download for every user

Since these seem rather optional imo it's time to think about how they can be downloaded manually like some of the other parts

@vanja-ivancevic

vanja-ivancevic commented Jul 25, 2026 via email

Copy link
Copy Markdown
Contributor Author

@tool4ever

Copy link
Copy Markdown
Contributor

Well some of the lists for the ingame downloaders already point at your domain anyway
so it might make sense to supply them from there
not sure if they can be called via adventure mode but ideally each plane would have its own list with links for its optional assets 🤔
depending on which location you choose some overlap from #11387 is possible

@tool4ever
tool4ever requested a review from Jetz72 July 26, 2026 17:01
@liminalwarmth

Copy link
Copy Markdown
Contributor

This is cool, and I would definitely use this feature. If you did package it into the new tabs interface I'm proposing, display would be a logical place to stick it, since there are other settings there that are similar, as tool4forever pointed out.

The tabs definitely become more useful as more GUI options get added, as I'm finding with the additional enhancements I'm doing on local that I haven't pushed upstream until there's more discussion about some of the existing pending changes.

More of an advanced feature, but it would also be neat if plane authors could assign (and distribute) background overrides for specific combat encounters or creature archetypes (if this doesn't already exist).

@vanja-ivancevic

Copy link
Copy Markdown
Contributor Author
  1. I really like your suggestion of tabbing the settings. We have way too many settings right now in one list.
  2. I was thinking about have these custom BGs just as a default setting for the plane's modder to design as they want, with fallbacks in place, as they are sort of a core visual game experience of plane. I don't fully see the need of enabling or disabling more backgrounds. As such, I would suggest to keep it out of settings for now.
  3. I 100% agree with your suggestion to have custom BGs for certain POIs and even enemies. I will look into what the best way to do this would be.

@Jetz72 Jetz72 added Enhancement New feature or request Adventure For the Adventure Module labels Jul 27, 2026

@Jetz72 Jetz72 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still iffy about third party content URLs for assets being included in the main repo. It's not unprecedented, but it's also not unprecedented that such a site proves unsustainable. Ideally we could someday shift to a system where entire Adventure planes can easily be downloaded and installed as complete packages, and then there's no risk of the user getting an incomplete experience. But for now I think this implementation is alright, pending confirmation on iOS handling.

Comment on lines +255 to +261
String adventureCacheDirectory = GuiBase.getAdventureCacheDirectory();
if (adventureCacheDirectory != null && !adventureCacheDirectory.isEmpty()) {
FileHandle cachedFile = Gdx.files.absolute(adventureCacheDirectory + ForgeConstants.SKIN_DIR + filename);
if (cachedFile.exists()) {
return cachedFile;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shoeless Will this work with the new iOS support? I saw in that PR that several instances of Gdx.files.absolute got swapped out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double-checked this with AI-assisted research against Apple’s filesystem guidance, LibGDX 1.13.5, and Forge’s existing iOS handling. absolute() is supported on iOS and is appropriate for this downloaded cache path, which is outside the read-only app bundle.
The latest revision routes all three lookups through Forge’s existing Assets.getFileHandle() helper. Bundled ASSETS_DIR resources therefore use internal() on iOS, while writable cache paths remain absolute. The iOS compatibility audit also passes. Thanks for flagging this.

@vanja-ivancevic vanja-ivancevic changed the title Add rotating Adventure battle backgrounds + new BGs for Old Border Shandalar Old Border Shandalar: Add rotating Adventure battle backgrounds Jul 28, 2026
@vanja-ivancevic vanja-ivancevic changed the title Old Border Shandalar: Add rotating Adventure battle backgrounds Add rotating Adventure battle backgrounds Aug 3, 2026
@vanja-ivancevic vanja-ivancevic changed the title Add rotating Adventure battle backgrounds Old Border Shandalar: Add rotating Adventure battle backgrounds Aug 3, 2026
@vanja-ivancevic vanja-ivancevic changed the title Old Border Shandalar: Add rotating Adventure battle backgrounds Add rotating Adventure battle backgrounds Aug 3, 2026
@vanja-ivancevic
vanja-ivancevic marked this pull request as ready for review August 3, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Adventure For the Adventure Module Enhancement New feature or request GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants