Skip to content

Preserve original artwork and add high-resolution rendering with map zoom - #207

Closed
genixpro wants to merge 27 commits into
masterfrom
codex/high-resolution-artwork-zoom
Closed

Preserve original artwork and add high-resolution rendering with map zoom#207
genixpro wants to merge 27 commits into
masterfrom
codex/high-resolution-artwork-zoom

Conversation

@genixpro

@genixpro genixpro commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Superseded by three focused draft PRs:

They are stacked in that order and pass the rebased gameplay/editor/replay and software checks. The combined runtime PNGs are unchanged. This PR is retained for its discussion and prior comparisons; review the replacements above.

This PR separates sprite resolution from logical geometry and adds 50%–300% map zoom to gameplay, replays and the editor. The 32-unit tile grid, building footprints and simulation orders remain unchanged.

The artwork direction is now original sources first. Stéphane recovered historical high-resolution artwork, layered GIMP files and concept paintings. These are organized together with the repository’s existing Blender, GIMP and vector sources in datasrc/gfx/:

  • originals/: buildings, units, resources, terrain, UI, cursors and overlays.
  • concept-art/: original building designs, kept separate from production sources.
  • reference-exports/: historical raster exports and style variants.
  • provenance/: archive-to-repository paths, previous repository paths and SHA-256 hashes.

The first archive and 95 pre-existing source files form 202 unique files. The second archive adds 34 artwork files, bringing the organized collection to 236; 15 AppleDouble filesystem metadata entries are documented and excluded from the artwork tree. Every committed source blob was checked against its recorded original hash. Attributes preserve historical line endings as well as binary data.

Original artwork guide · Browsable catalog · Coverage and open questions

Migration status: sixty frames now use recovered original artwork. Five papyrus growth stages now use the original 199×199 XCF layers. All 24 guard, clearing and forbidden area-marker frames now use native 128×128 original exports, preserving their eight-frame sequences and transparency without AI. All ten tree growth/variant frames use five first-archive GIMP originals, preserving native alpha and layer opacity. Eight wheat frames now also use native 128×128 GIMP originals; ripe color states ressource14/ressource19 retain their existing upscales because matching larger variants were not recovered. The resource atlas uses the final trees and wheat at every mip level. From the second archive, both hive states, all three flags and five shared construction sprites now use deterministic original-source exports, with no AI. White backgrounds are removed, native construction masks are used, and neutral shadows remain separate from green team layers. All sixty frames retain logical sizes; native source detail ranges from 1.33× to 8×. buildingsite0, the unused Construction160 arrangement and classic-size direction templates are not forced into unmatched slots. All 16 first-archive XCF identities are mapped. The completed school and first two racetracks now use verified original base/team exports with saved layer opacity (school team alpha 64). Hospital and defense-tower trial exports did not match the classic finishing, mechanical inn/racetrack sources did not supply complete final colored layers, and no damage/construction combinations were verified; those retain existing fallbacks. A direct-versus-split GIMP composite audit found only rounding differences (maximum 3/255); the smaller tower XCF reproduces classic visible team pixels and alpha exactly. Splitting layers does not explain the larger-source appearance differences. The original files remain unchanged; no editing history is inferred. Other source migrations remain pending. Existing upscales remain for other frames. Recipes and coverage. Stéphane has contacted the original artists; outstanding questions include walls, terrain generation details, tower-2-tex.png, and damage/construction layer combinations.

HD defaults on for OpenGL sessions; explicitly saved classic preferences are respected. Classic/software assets and invalid-pack fallbacks remain intact. This remains a draft for renderer and artwork review.

Current runtime pack: before → after at matching resolution

Left: original source enlarged 4×. Right: final runtime artwork at exactly the same dimensions. Originals use nearest-neighbor enlargement so the comparison makes the missing source detail visible. Both sides use the same background and team-color convention. These are direct composites of the current runtime layers, including the recovered original replacements. Click to inspect full-size images.

Inn construction and hospital damage

Inn construction: original versus final
Hospital damage: original versus final

Preserved pool and recovered original school

Pool: original versus final
School: original versus final

Recovered original hive and translucent tower crystals

Swarm: original versus final
Damaged tower: original versus final

Complete final comparison gallery — all 487 frames, including construction/damage states, walls, flags, shared construction and all 272 terrain frames. It contains only original → final comparisons, with no intermediate trials or pipeline-stage galleries.

Resource sprites

Resource clusters: original versus final
Resource growth states: original versus final

Upscaling pipeline and what the experiments established

  • Constrained Real-ESRGAN x4plus supplies the initial RGB detail. Transparent RGB is filled from nearby visible pixels and buildings are padded before inference. Broad source color/shading is restored after inference; only a controlled amount of model detail is retained. Alpha and team layers remain separate.
  • Per-frame finishing resolves mixed blurry/hard contours and preserved source stair-steps. Outline repair combines learned alpha with the original, applies a narrow smoothing pass and preserves translucent shadows. Painted repair mixes 45% of the alternative structural restoration into the painted baseline. Tower crystals receive an opacity-preserving variant. The final selection preserves those choices; the approved pool0b0 output remains byte-identical; school1b0 now uses the recovered original in preference to its experimental baseline.
  • Recovered originals take precedence. All 24 area-marker frames, three completed layered buildings, ten tree frames, eight wheat frames, five papyrus stages, both swarm states, three flags and five construction frames now come from the recovered archives, without AI. The native renders/mattes supply geometry and alpha; shadows are subdued to the classic style. Complete source/output hashes and recipes are recorded. The generated swarm candidates remain historical experiments, not the active runtime selection.
  • One universal treatment did not work. Generator repainting worked well for the swarm but failed on inn construction fragments; full anime restoration simplified painted textures; unconstrained alpha reconstruction could over-brighten translucent overlays. Those findings led to selective finishing and protected references. Rejected candidates are not presented as PR visuals.
  • Generated grass and water materials replace blotchy grass with short flat grass with subdued contrast and flat water with subtle small painted ripples. Grass retains 65% of generated contrast; water retains 55% contrast and 80% chroma after mean-color matching. Resource readability at normal 100% zoom governs material selection. Water uses periodic correction and matching opposite edge collars through four mip levels, and the existing scrolling animation. Only approved final material tiles are retained; runtime use requires no AI tooling.
  • Terrain is a connected tileset. Shared periodic grass/sand materials and corner-based transition masks replace independently finished tiles. Compatible RGBA edge profiles and corner pixels are matched at each mip before padding and packing. Shared irregularity restores rugged shoreline outlines while preserving matching joins; tile IDs, simulation terrain and picking stay unchanged. Ten tree and eight wheat frames now use original GIMP exports and native alpha; the other 42 resource frames retain constrained RGB finishing and source alpha; water and other non-unit effects remain included.

The runtime pack has 487 frames / 546 layers, versioned manifests, logical/layer dimensions and provenance hashes. It ships independently of models, Python and experimental outputs. Only approved finals, original-source exports and runtime validation/packaging tools are retained; historical experiments and AI intermediates are excluded from the PR.

Detailed pipeline, selected recipes and design explanation.

Recovered flags and construction

Recovered flag: original versus final
Recovered construction: original versus final

Recovered wheat

Wheat: classic versus recovered original

Recovered racetracks

Earthen racetrack: classic versus recovered original
Gothic racetrack: classic versus recovered original

Recovered area markers

Forbidden marker: classic versus recovered original

Code changes for map zoom

  • Separate original sprite geometry/CPU surfaces from GPU high-resolution surfaces and texture regions. Smaller team layers retain their original registration. Missing/invalid layers reject the whole HD frame.
  • Add MapCamera with fractional world origin, zoom, viewport bounds, inverse input conversions and toroidal helpers. Derive integer tile origins and fractional offsets for existing map renderers.
  • Apply a scoped GL world transform to terrain, buildings, units, fog, clouds, particles, effects and world overlays. Flush sprite batches across transform changes and restore state before UI. This does not enlarge a low-resolution map framebuffer.
  • Convert placement, hover, selection, drag tools, editor painting, ghosts, minimap navigation and event-centering through the camera. Keep particles in world space; adjust panning for zoom.
  • Add Alt+wheel pointer-anchored zoom, fractional wheel input and visible − / 100% / + controls at the bottom of the right sidebar in gameplay/replays (bottom left in the editor). Building action buttons and their hit targets move up to reserve the footer. Intercept Alt before building-adjustment orders. Sessions start at 100%; zoom does not enter saves, replay orders or multiplayer state.
  • Derive culling from viewport/zoom and repeat the toroidal map to fill the viewport, including multiple full periods. Repeated appearances pick the same underlying tile/object; visual state advances once, independently of the number of copies. Screen-edge indicators, menus and sidebar remain screen-sized relative to map zoom.
  • Keep normalized 2D textures, HD linear filtering/mipmaps and padded terrain batching. Team-color caches are lazy and released with session resources. HiDPI uses the actual GL drawable; fullscreen toggles preserve the context.

Window resizing here scales/letterboxes the configured logical resolution. It does not provide the reflow/exposed-event cache in #198; that PR overlaps renderer/window code and needs coordinated integration.

Actual in-game screenshots

Gameplay at 300%:

Gameplay at 300%

Material detail at normal 100% map zoom, with quiet flat grass and subtle ripples:

Grass and water at 100%

Editor at 300%, showing the expanded shoreline, water and resource pack:

Editor shoreline at 300%

Small map at 50%, repeating to fill the viewport:

Repeating map at 50%

Validation and performance

Rechecked on the clean PR branch based on current master:

  • Optimized game and integration-harness builds pass.
  • 171/171 CppUnit tests pass, including wheel-control regressions.
  • Pack re-export from the committed selected sources and validation pass: 487 frames, dimensions, RGBA/layer coverage, hashes, locked pool output and independently validated original school layers and padded mip levels.
  • Camera tests pass: conversions, tile picking, fractional pointer anchors, limits, resize and wrapped/small-map cases.
  • Direct game/editor event-handler integration passes: placement orders and brush tiles at 50/100/200/300%, Alt-wheel order isolation, zoom buttons, fullscreen center preservation, replay drawing, matching simulation checksums and session resource release.
  • Water edge checks pass through four mip levels; updated sidebar reset handling leaves building orders unchanged.
  • Software gameplay/editor checks pass: original artwork, 100% map scale and unavailable zoom.

The expanded pack additionally passes every frame in all 16 hues, missing/invalid pack fallbacks and bounded cache reuse/release. Pixel checks catch incomplete atlas mip chains that do not trigger GL errors. Native mouse automation was unreliable, so the integration harness drives real engine handlers directly and captures GL output.

Expanded-pack measurements on the development Mac:

Dense four-team fixture Original artwork HD artwork
GPU allocation, dense four-team scene ~45 MB ~358 MB
Frame time at 50% ~8.2 ms ~11.8 ms
Frame time at 300% ~1.7 ms ~1.6 ms
Draw calls at 50% 24,623 24,634
Draw calls at 300% 613 613

Terrain and resources remain batched. The all-487-frames/all-16-hues stress case uses ~856 MB CPU / 1.50 GB GPU memory and 944 colored frames, stabilizes on repeat drawing and releases on session close. These are local measurements against the updated renderer with original artwork, not a historical-renderer or cross-platform benchmark. The 50% cost and memory footprint warrant review on slower devices.

Build/run instructions and measurement limits.

Unit artwork follow-up

Unit upscaling can be done at the same time as #201, which increases core unit animation poses from 8 to 32. Finish the expanded sequences together so silhouette, team masks, anchoring and detail remain consistent between frames. This PR makes units follow map zoom but leaves their textures unchanged; it does not duplicate the unit animation work.

Question for reviewers: should classic artwork remain selectable?

This PR now enables HD artwork by default and retains the setting to switch back to classic artwork. Do we want to keep that user-facing classic option long-term, or make HD the only selectable OpenGL artwork once accepted? The switch remains in this implementation pending that discussion. This is separate from retaining original assets internally: software rendering and missing/invalid-pack fallback still need them.

Playtest fixes included

  • Preserve opposite-edge portions of wrapped buildings and moving units when a full map period is visible, without duplicating building identity for interaction.
  • Draw the complete minimap viewport outline when its width/height spans the map, instead of collapsing coincident wrapped endpoints into a line.
  • Size the custom cursor in Cocoa window points so Retina density is not applied twice; map zoom never affects its size.

The new full-period seam, minimap and native-cursor regression checks pass, along with the gameplay/editor/replay integration, software checks and 171-test suite.

The expanded pack includes the resource sprites and remaining non-unit world artwork. Terrain now uses shared periodic materials and matching edge/corner profiles rather than independently finished transition frames. Units, including their death animation frames, stay with #201.

Connected terrain playtest fix

Terrain is built as a connected tileset. Generated grass adds short flat grass with subdued contrast while sand retains its selected grain. Both materials are made periodic and grass retains the original mean palette. Transition masks follow the engine's four-corner grass/sand/water lookup, with shared boundary irregularity and seeded interior variation. Compatible edge profiles and corner pixels are matched in RGBA at every mip level before padding and packing. This changes the shoreline artwork, while tile IDs, simulation terrain and picking remain unchanged. All 91,136 allowed directed joins across four mip levels are checked against the exported atlas, along with every corner class.

Connected terrain: original enlarged 4x versus final at the same dimensions

HD remains enabled by default. Explicitly saved classic preferences are respected; existing users without this setting inherit the HD default.

Current handoff

60 runtime frames now use recovered originals, including all five papyrus growth stages. Project handoff records reproducible exports, validation, remaining source gaps and next steps. Cyrille found no further files. Remaining UI sources use an older gold style; recovered water/cloud raster canvases are no larger than classic. Existing fallbacks remain where no matching larger source is verified.

Papyrus: classic enlarged versus original-source final

Physical separation of production artwork

Approved inputs now live under datasrc/gfx/production/ in separate original-derived/, ai-upscaled/, ai-materials/, and resampled-masks/ folders, with atlases and metadata separate. Untouched originals, original export intermediates, historical experiments, classic runtime and assembled HD runtime retain distinct homes. Normal packaging uses only approved inputs and the Python standard library; it does not read experiment outputs. All 557 packaged files are byte-identical to the previous runtime pack. Missing layers, corrupt inputs and wrong-origin placement are rejected.

Folder layout and workflow.

Final-only scope

Removed all 855 tracked files under the historical experiment tree. Final comparisons remain, while the runtime validator, comparison generator and GL pack check now live with production tools/tests. Normal packaging requires only approved final inputs. All runtime PNGs are unchanged by this cleanup.

@genixpro genixpro changed the title Add opt-in 4× artwork and 50%–300% map zoom Add default HD artwork and 50%–300% map zoom Sep 8, 2026
@stephanemagnenat

stephanemagnenat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I have some of the original models in higher resolution, way better then AI upscaling, but it is a mess. I actually find the AI upscaling not working well for most models and losing quite some of the Globulation spirit, feeling very much AI slop in some cases.

If someone has the time to sort, I could build a zip and drop it off somewhere.

@genixpro

genixpro commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

I have some of the original models in higher resolution, way better then AI upscaling, but it is a mess. I actually find the AI upscaling not working well for most models and losing quite some of the Globulation spirit, feeling very much AI slop in some cases.

If someone has the time to sort, I could build a zip and drop it off somewhere.

oh shit really? please comment with the zip file. yes that would be way better. I was able to rerender the units at higher resolution and frame rates using the blender files in the repo. if you have the artwork at high res, that would be perfect

@stephanemagnenat

stephanemagnenat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

After some heroic digital archeology, here it is:
https://h.magnenat.net/~steph/glob2-highres.zip

Not everything is in high res, but quite some things are, like the resources, quite some buildings, quite some UI elements, most guard markers. Most buildings are in the GIMP format, with the layer separated. That would allow to possibly mix some AI enhancement along with the original graphics, as in some cases some textures do not look that good in high-res there.

I also attached some conceptual graphics from the original artist who designed the buildings.

@genixpro

genixpro commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@stephanemagnenat Thank you so much for digging these up and sharing them! This is amazing, and having the original artwork and separated layers is exactly what we needed.

We’re going to commit the originals to the repository, then use those sources to render the higher-resolution versions for the game. That will let us preserve the original Globulation look while taking advantage of the new high-resolution rendering and map zoom support. Thank you for saving these—and for the digital archaeology to recover them!

@stephanemagnenat

Copy link
Copy Markdown
Contributor

Even older dig, we are now back in 1998: https://h.magnenat.net/~steph/glob2-highres-more.zip

We got a slightly higher resolution hive, high-resolution flags, and some generic construction site images (not sure whether they are still relevant).

@stephanemagnenat

Copy link
Copy Markdown
Contributor

It would be good to do a bit of sorting and cleanup before committing, so that there is not too much mess in the repo! The authors are mostly Luc-Olivier de Charrière and Emmanuel Eckard and Cyrille Dunant, with some others for some elements, see https://github.com/Globulation2/glob2/blob/master/data/authors.txt

@genixpro

genixpro commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks again, Stéphane! We’ve inventoried the archive and are organizing it together with the existing Blender/GIMP/vector sources, preserving the original files unchanged. We’ll prioritize rendering from originals and keep our current upscales only where usable originals aren’t available.

A few questions from the initial inventory—do you happen to have any more of these, or remember how they map?

  • Grass/sand terrain: I found the water sources and variants, but no obvious source set for the grass, sand and their transition tiles. Do those originals survive anywhere?
  • Small building canvases: auberge-goth-64.xcf and building8.xcf are 64×69, science1.xcf is 64×70, and tower1.xcf is 64×108. Are there larger versions or original models for these?
  • Historical building names: Any clues for mapping building10, building3r, __building5, __building12 and __building19 to the game’s buildings/levels would help.
  • Other states and families: We haven’t yet established coverage for the swarm, walls/flags, shared construction artwork and damaged/construction states, or resource families beyond trees and the two wheat styles. Some may be inside the supplied layers or under older names, so we’re not treating them as definitely missing—any pointers or additional originals would be very welcome.

No need to sort another archive first; we can do that. Even a rough recollection of filenames or which layers represent which state would be helpful!

Update after visual inspection: We’ve now matched all 16 building XCFs to their building families/levels, including the numbered names, by comparing the hidden layers with current game sprites. building10 is racetrack level 2, building3r racetrack level 1, building8 inn level 2, __building5 barracks level 1, and __building12/__building19 both barracks level 3 variants (human-facing levels). So no need to chase those identities for us! The questions about additional/larger sources and state coverage still stand.

@genixpro genixpro changed the title Add default HD artwork and 50%–300% map zoom Preserve original artwork and add high-resolution rendering with map zoom Sep 8, 2026
@stephanemagnenat

stephanemagnenat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Grass/sand terrain

I asked Luc, who drew them originally. Not sure because they were rendered using a 3D rendering program on MacOS classic, but who knows.

Small building canvases

I have contacted Cyrille, the person who did paint the buildings. I do not have better resolution for these unfortunately. I wonder whether we could find some context aware AI upscaling tool and give them the other high-resolution building as input, as well as the low-resolution ones. Note that for some of them, the concept art is actually the line art that was then colored, maybe it is useful?

Other states and families

Hive (partially) and flags are in the second zip.

I could not find high-resolution for the walls, but I would assume they used to exist.

For the damaged/construction states I would assume they are different layer selection (best case, could be re-exported from the xcf) or manual changes on the final graphics (worst case).

I wonder how to use AI optimally to do style transfer from a small number of high resolution buildings to the others.

@stephanemagnenat

stephanemagnenat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Actually, I have an idea. We could try to set up some funding source so that players could contribute and we could hire an artist to fill the gaps and upgrade the buildings. I know some good artist I am used to work with (but they are in Switzerland, so not that cheap). The challenge would be to do that in a seamless way regarding legal, tax, etc.

@genixpro

genixpro commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks again, Stéphane, including for contacting Luc and Cyrille! We’ve committed the organized first collection and downloaded the second ZIP to check the hive, flags and construction images. All the numbered building XCFs are now identified.

The short remaining search/question list is:

  • Walls: larger originals, if they turn up; understood that you haven’t found them yet.
  • Terrain: if the old Mac rendering sources are gone, any remembered program/material/noise settings or generation recipe for grass, sand and transitions would help. Thanks for asking Luc.
  • Missing tower texture: the existing tower-2.blend references tower-2-tex.png, which is not in our organized collection. Does that survive anywhere?
  • Building states: any remembered layer combinations/export steps for damaged/construction states and team colors. We’re inspecting the XCF layers ourselves before declaring states missing.

I’ve also sent this by email. We’ll use usable originals first and retain existing upscales only where needed, with minimum AI. We’ll audit the second archive before asking you to search for its hive/flag/construction assets.

@stephanemagnenat

Copy link
Copy Markdown
Contributor

Cyrille did not find any more files.

Note that it would be good to keep a clear track of which asset is an original high resolution, and which one is an enlarged/super resolution. In the future if we either find a smarter style-aware super resolution method and/or hire an artist, this would be most helpful to track the improvement.

@Giszmo

Giszmo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I would love to see higher resolution graphics and a way to scale up as my screen is ridiculously high res, making the game unplayable in windowed mode.

I would love to see the original artwork shine through in this re-master.

I'm not emotionally attached to the artists though or convinced, LLMs can't produce the best style without paying an artist a Swiss salary. The genixpro assets are in part inconsistent in their restauration but I'm confident, we can figure that out without bringing in a graphics expert.

@genixpro genixpro closed this Sep 9, 2026
@stephanemagnenat

stephanemagnenat commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Fyi, Luc checked and did not find further artwork. To make the terrains and the hive and the original globules (since then remade with Blender), he used Bryce3D on MacOS 7.5 classic.

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.

3 participants